我想在LinkedIn上获取特定角色的数据。但是,我不知道如何遍历所有搜索结果以提取信息。搜索结果的数量大约为4191(大约180-200页)。下面是代码:
count = 1 而计数<4192:
id_text = raw.find('code', {'id':'decoratedJobPostingsModule'})
data = []
for d in id_text:
data.append(json.loads(d))
for num in range(0, len(data[0]['elements'])):
job_site_link = data[0]['elements'][num]['companyTextUrl']
company_name = data[0]['elements'][num]['decoratedJobPosting']['companyName']
job_title = data[0]['elements'][num]['decoratedJobPosting']['jobPosting']['title']
city = data[0]['elements'][num]['decoratedJobPosting']['formattedLocation']+" ("+data[0]['elements'][num]['decoratedJobPosting']['cityState']+")"
result= result.append({'Job site Link':job_site_link, 'Company name':company_name, 'Job title':job_title, 'Company City':city,}, ignore_index=True)
count=count+1