0

我正在尝试从公开个人资料中获取所有信息。Linkedin 说我应该能够得到:

<id>
<first-name>
<last-name>
<headline>
<location>
  <name>
  <country>
    <code>
  </country>
</location>
<industry>
 <current-status>
<current-status-timestamp>
<connections total="" >
<summary/>
<positions total="">
  <position>
    <id>
    <title>
    <summary>
    <start-date>
      <year>
      <month>
    </start-date>
    <is-current>
    <company>
      <name>
    </company>
  </position>
</positions>

我只能得到

<headline>
<first-name>
<last-name>

请让我知道如何更改我的代码:

CONSUMER_KEY = '9pux1XXXXXX'     # This is api_key
CONSUMER_SECRET = 'brtXoXXXXXXX'   # This is secret_key

USER_TOKEN = '27138ae8-5XXXXXXXXXXXXXXXXXXXXXXXXXXX'   # This is oauth_token
USER_SECRET = 'ca103e23-4XXXXXXXXXXXXXXXXXXXXXXXXXX'   # This is oauth_secret
RETURN_URL = 'http://localhost:8000'

from linkedin import linkedin
from oauthlib import *

# Define CONSUMER_KEY, CONSUMER_SECRET,  
# USER_TOKEN, and USER_SECRET from the credentials 
# provided in your LinkedIn application

# Instantiate the developer authentication class

authentication = linkedin.LinkedInDeveloperAuthentication(CONSUMER_KEY, CONSUMER_SECRET, 
                                                      USER_TOKEN, USER_SECRET, 
                                                      RETURN_URL, linkedin.PERMISSIONS.enums.values())

# Pass it in to the app...

application = linkedin.LinkedInApplication(authentication)

# Use the app....

a = application.get_profile(member_url='http://www.linkedin.com/pub/louis-litt/56/464/816')

当我运行程序时,我得到的是:

{u'headline': u'Senior Associate at Pearson Hardman', u'lastName': u'Litt', u'siteStandardProfileRequest': {u'url': u'http://www.linkedin.com/profile/view?id=198202770&authType=name&authToken=yIgW&trk=api*a295771*s303335*'}, u'firstName': u'Louis'}
4

2 回答 2

1

Linkedin现在已经对程序开发者进行了限制访问,所以基本上只能从以下4个方面进行选择:r_basicprofile, r_emailaddress, rw_company_admin, w_share

于 2017-08-01T06:29:28.547 回答
0

您正在尝试获取用户的公开资料,这只会产生某些字段,具体取决于用户选择在其公开资料和 LinkedIn 设置上显示的内容。

尝试抓取您自己的个人资料http://api.linkedin.com/v1/people/~,您应该能够检索所有字段。

于 2013-07-12T10:57:19.933 回答