对linkedin进行身份验证

时间:2016-04-10 14:22:51

标签: python 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'

我做错了什么?

0 个答案:

没有答案