2013-07-11 97 views
0

我想从公共个人资料中获取所有信息。 LinkedIn说我应该能够得到:没有得到从linkedin的完整个人资料信息python

<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'} 
+0

如果LinkedInApplication.get_profile文档不指定任何其他调用参数,然后从linkedin获得支持(假设他们写了该库)。 – dilbert

+0

@dilbert我试图得到他们的支持。在他们的网站上发布一个问题....没有回应,但它只是一天 – user1681664

回答

0

Y您试图获取用户的公开个人资料,这只会产生某些领域,取决于用户选择在他的公开个人资料上显示的内容以及LinkedIn的设置。

试着抓住你自己的档案http://api.linkedin.com/v1/people/~,你应该能够检索所有的字段。

+0

,当我尝试将该网址放入代码中时,它会返回错误 – user1681664

+0

,当我抓住我自己的配置文件时,它仍会返回相同的有限信息 – user1681664

+0

你在说什么没有意义。什么是您用来抓取您自己的个人资料的个人资料网址? –

1

LinkedIn已经限制了程序开发的访问,所以基本上你只能从以下4个方面选择r_basicprofile,r_emailaddress,rw_company_admin,w_share

相关问题