如何在LinkedIn上抓取数百个页面的同时循环浏览所有页面?

时间:2018-08-23 04:41:26

标签: python web-scraping beautifulsoup

我想在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

0 个答案:

没有答案