让你的公司限制地点输出到5?

2024-04-28 20:15:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试获取LinkedIn中一家公司拥有的所有位置,但似乎仅限于5个。我需要更改哪些参数以增加返回的位置数?你知道吗

例如,我的公司Slalom Consulting大约有15个地点,但只返回5个。我不能让第二个“\u总数”增加到5以上。你知道吗

app.get_companies(company_ids=[166000], selectors=['name', 'locations'], params={})

{
 "_total": 1, 
 "values": [
  {
   "_key": "166000", 
   "locations": {
    "_total": 5, 
    "values": [
     {
      "contactInfo": {
       "fax": "", 
       "phone1": "206 483 5700"
      }, 
      "address": {
       "postalCode": "98104", 
       "city": "Seattle", 
       "street1": "Suite 1900"
      }
     }, 
     {
      "contactInfo": {
       "fax": "310-322-6888", 
       "phone1": "310-322-6800"
      }, 
      "address": {
       "postalCode": "90245", 
       "city": "El Segundo", 
       "street1": "Suite 600"
      }
     }, 
     {
      "contactInfo": {
       "fax": "415-593-3451", 
       "phone1": "415-593-3450"
      }, 
      "address": {
       "postalCode": "94105", 
       "city": "San Francisco", 
       "street1": "Suite 1550"
      }
     }, 
     {
      "contactInfo": {
       "fax": "972-294-7301", 
       "phone1": "972-294-7300"
      }, 
      "address": {
       "postalCode": "75024", 
       "city": "Plano", 
       "street1": "Suite 480"
      }
     }, 
     {
      "contactInfo": {
       "fax": "312.329.0461", 
       "phone1": "312.329.0401"
      }, 
      "address": {
       "postalCode": "60601", 
       "city": "Chicago", 
       "street1": "Suite 5300"
      }
     }
    ]
   }, 
   "name": "Slalom Consulting"
  }
 ]
}

Tags: namecityaddress公司consultingsuitetotalvalues
1条回答
网友
1楼 · 发布于 2024-04-28 20:15:38

我知道我需要添加一些参数,但不知道我需要做什么才能得到超过5个位置。你知道吗

from linkedin import linkedin 
import json
import csv

##start connection to LinkedIn
CONSUMER_KEY = 'xxx'
CONSUMER_SECRET = 'xxx'
USER_TOKEN = 'xxx'
USER_SECRET = 'xxx'
RETURN_URL = '' # Not required for developer authentication
# Instantiate the developer authentication class
auth = linkedin.LinkedInDeveloperAuthentication(CONSUMER_KEY, CONSUMER_SECRET, USER_TOKEN, USER_SECRET,RETURN_URL, permissions=linkedin.PERMISSIONS.enums.values())

app = linkedin.LinkedInApplication(auth)

co = app.get_companies(company_ids=[166000], selectors=['name', 'locations'], params={})
print co

相关问题 更多 >