######################首先使用requests获取前程无忧一级网页
import requests
from lxml.etree import HTML
import re
import time
page=1
while True:
url=‘https://search.51job.com/list/020000,000000,0000,01,2,99,%2B,2,{
}.html?lang=c&stype=1&postchannel=0000&workyear=99&cotype=99°reefrom=99&jobterm=99&companysize=99&lonlat=0%2C0&radius=-1&ord_field=0&confirmdate=9&fromType=5&dibiaoid=0&address=&line=&specialarea=00&from=&welfare=’
try:
rst=requests.get(url.format(page))
rst.apparent_encoding
rst.encoding=‘GB2312’
rst=rst.text
html=HTML(rst)
ls=html.xpath(’//[@id=“resultList”]/div[.]/p/span/a/@href’) #Xp
python爬取前程无忧招聘岗位信息
最新推荐文章于 2024-07-09 14:45:02 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)