0
我想寫得到一些用戶的LinkedIn的個人資料,只是打印出來驗證到LinkedIn
代碼,這是我的代碼
from linkedin import linkedin
CONSUMER_KEY = "XXXXX"
CONSUMER_SECRET = "XXXXX"
RETURN_URL = r"http://localhost:8000"
authentication = linkedin.LinkedInAuthentication(CONSUMER_KEY, CONSUMER_SECRET,
RETURN_URL, linkedin.PERMISSIONS.enums.values())
application = linkedin.LinkedInApplication(authentication)
a = application.get_profile(member_url=my_url)
print(a)
我收到以下錯誤
Traceback (most recent call last):
File "C:/Users/Linkedin/main.py", line 28, in <module>
a = application.get_profile(member_url=my_url)
File "C:\Python34\lib\site-packages\python_linkedin-4.2-py3.4.egg\linkedin\linkedin.py", line 189, in get_profile
response = self.make_request('GET', url, params=params, headers=headers)
File "C:\Python34\lib\site-packages\python_linkedin-4.2-py3.4.egg\linkedin\linkedin.py", line 169, in make_request
params.update({'oauth2_access_token': self.authentication.token.access_token})
AttributeError: 'NoneType' object has no attribute 'access_token'
我做錯了什麼?
我收到一個錯誤「AssertionError:您必須先獲得授權碼」 –
已更新答案。需要認真遵循文檔 – shivg
「授予訪問權限」是什麼意思?我該怎麼做才能自動找到授權碼? –