簡體   English   中英

無法從linkedin python獲取完整的個人資料信息

[英]Not getting full profile info from linkedin python

我正在嘗試從公開資料中獲取所有我可以得到的信息。 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'}

Linkedin現在限制了程序開發人員的訪問權限,因此基本上您只能從以下4個方面進行選擇:r_basicprofile,r_emailaddress,rw_company_admin,w_share

您正在嘗試獲取用戶的公開個人資料,這只會產生某些字段,具體取決於用戶選擇在其公開個人資料上顯示的內容以及LinkedIn的設置。

嘗試獲取您自己的個人資料http://api.linkedin.com/v1/people/~ ,您應該能夠檢索所有字段。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM