Python LinkedIn搜索API 403错误 [英] Python LinkedIn Search API 403 error

查看:81
本文介绍了Python LinkedIn搜索API 403错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取X公司工作人员的公开个人资料,以获取其头衔,ID和联系.如何正确使用Search API,以免出现403 Forbidden错误?

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.        

搜索API是否已更新,所以无法访问搜索.我不想使用普通搜索并复制粘贴所有内容.

Was the search API updated so search cannot be accessed. I do not want to use the normal search and copy paste everything.

推荐答案

因此,LinkedIn似乎具有经过审核的开发者访问权限程序

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://www.seleniumhq.org/

Another option would be to try using selenium to get the data http://www.seleniumhq.org/

Python绑定可以在这里找到: https://selenium-python.readthedocs.org/

Python bindings can be found here:https://selenium-python.readthedocs.org/

这篇关于Python LinkedIn搜索API 403错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆