我有一个问题,我不能刮教育,经验部分在LinkedIn的个人资料使用 selenium 和BeautifulSoup。
现在,我已经成功地刮名字,标题和位置.但对于教育和经验部分,我注意到,当我打开inspect时,html标签中有变化,这让我很难识别部分并使用beautifulSoup提取.有人有解决方案吗?这里的代码的例子:
experience = soup.find("section", {"id": "experience-section"}).find('ul')
print(experience)
li_tags = experience.find('div')
a_tags = li_tags.find("a")
job_title = a_tags.find("h3").get_text().strip()
print(job_title)
company_name = a_tags.find_all("p")[1].get_text().strip()
print(company_name)
joining_date = a_tags.find_all("h4")[0].find_all("span")[1].get_text().strip()
employment_duration = a_tags.find_all("h4")[1].find_all("span")[1].get_text().strip()
print(joining_date + ", " + employment_duration)
here you can see the section id, where the number is changing
the inspect that i expect should be like this
2条答案
按热度按时间smdncfj31#
你可能会发现它很有用。下面的脚本首先使用邮件和密码登录到LinkedIn,然后通过单击个人资料头像进入个人资料部分,最后获取个人资料的页面源,并使用beautifulsoup对其进行解析。
你可以像解析经验部分一样解析其他部分,比如教育、认证等。
z8dt9xmd2#
我没有答案,但在相同的情况下.你用Python做了这个,有任何运气吗?很想从LinkedIn刮我的简历到其他格式,并能够相应地调整记录.谢谢很多.