需求:爬取腾讯招聘岗位 、翻页
https://careers.tencent.com/search.html?index=1
如下:
第一步 分析页面
1、数据在哪里获取?
我们在网页源代码中找下,是否有目标数据:
显然原代码中并没有关于招聘岗位的信息,所以我们不能对该url(https://careers.tencent.com/search.html?index=1)发起并获得响应,再替换page的数字来翻页,进而完成任务。
我们右键检查,在network-XHR中,可以发现下图右下角红框,点击看到response,ctrl+f搜索招聘岗位中的25927,发现了response中包含该数据。
,就确认了我们要的目标url就在对应的Headers中,见下图。
即目标url:
https://careers.tencent.com/tencentcareer/api/post/Query?timestamp=1625539350923&countryId=&cityId=&bgIds=&productId=&categoryId=&parentCategoryId=&a