1

Now I am trying to use linkedin python api to get users' information, below is my code:

from linkedin import linkedin

API_Key='...'
API_Secret='...'
Return_url='http://localhost:8000'

authentication = linkedin.LinkedInAuthentication(API_Key, API_Secret, Return_url, linkedin.PERMISSIONS.enums.values())
print(authentication.authorization_url)  # open this url on your browser
application = linkedin.LinkedInApplication(authentication)
application.get_profile()

However, it show the error:

AttributeError: 'NoneType' object has no attribute 'access_token'

And another problem is, if i have a name of the person, how to use api to get the person's information?

1 Answers1

1

Don't have the rep to comment, but see this answer: Python: Attribute Error - 'NoneType' object has no attribute 'something'

This is the equivalent of a null pointer exception in java. Whatever object you are trying to access "access_token" field, it is null. If that object is what's returned from a function call, perhaps that function call failed.

Also see Authenticate to linkedin

problems with LinkedIn API connection

Using oauth2_access_token to get connections in linkedIn

pellucidcoder
  • 127
  • 3
  • 9