我试图用Python访问linkedin。下面是我使用的简单代码。在
问题是我每次都需要登录openbrowser来发布返回的\u url以获取授权代码,它在我第一次运行时工作,而这个代码在我重新运行python代码时过期。在
以下是我的代码:
from linkedin import linkedin
API_KEY = '<mykey>'
API_SECRET = '<mysecret>'
RETURN_URL = 'https://www.linkedin.com/uas/oauth/authorize'
authentication = linkedin.LinkedInAuthentication(API_KEY, API_SECRET, RETURN_URL, linkedin.PERMISSIONS.enums.values())
Url= authentication.authorization_url # open this url on your browser
print Url
authentication.authorization_code ="<authcode>"
application = linkedin.LinkedInApplication(authentication)
authentication.get_access_token()
目前没有回答
相关问题 更多 >
编程相关推荐