问题
I am trying to get public profiles of people who work in company X to get their title, id, and connection. How do I properly use the Search API so I do not get 403 Forbidden error?
from linkedin import linkedin
CONSUMER_KEY = 'XXX'
CONSUMER_SECRET = 'XXX'
USER_TOKEN = 'XXX'
USER_SECRET = 'XXX'
RETURN_URL = ''
auth = linkedin.LinkedInDeveloperAuthentication(CONSUMER_KEY, CONSUMER_SECRET,
USER_TOKEN, USER_SECRET,
RETURN_URL,
permissions=linkedin.PERMISSIONS.enums.values())
app = linkedin.LinkedInApplication(auth)
mm=app.search_profile(selectors=[{'people': ['headline','id','num-connections',]}], params={'keywords': 'microsoft'})
print mm
So this code gives me a error
Message File Name Line Position
Traceback
<module> <module1> 30
search_profile C:\Python27\lib\site-packages\linkedin\linkedin.py 194
raise_for_error C:\Python27\lib\site-packages\linkedin\utils.py 65
LinkedInForbiddenError: 403 Client Error: Forbidden: Access to people search denied.
Was the search API updated so search cannot be accessed. I do not want to use the normal search and copy paste everything.
回答1:
So it appears LinkedIn has a vetted process for developer access
http://developer-programs.linkedin.com/forum/error-403-client-error-forbidden-unknown-error
and you might have call customer service and agree to a TOS
http://community.linkedin.com/questions/116784/how-can-i-get-vetted-api-access-to-use-the-people.html
Another option would be to try using selenium to get the data http://www.seleniumhq.org/
Python bindings can be found here:https://selenium-python.readthedocs.org/
来源:https://stackoverflow.com/questions/29174780/python-linkedin-search-api-403-error