import requests
import re
url = 'https://search.51job.com/list/040000,000000,0000,00,9,99,%25E6%259C%25BA%25E6%25A2%25B0,2,1.html'
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Safari/537.36 Core/1.70.3861.400 QQBrowser/10.5.4313.400"
}
page_text = requests.get(url=url,headers=headers).text
pat_job_href = r'"job_href":"(.*?)\?'
job_href = re.findall(pat_job_href,page_text,re.S)
for item in job_href:
print(item)
G:\python_demo\shixun\51job\venv\Scripts\python.exe G:/python_demo/shixun/51job/test/testBS.py
https:\/\/jobs.51job.com\/shenzhen-gmxq\/102023045.html
https:\/\/jobs.51job.com\/shenzhen-baq\/128474531.html
https:\/\/jobs.51job.com\/shenzhen-baq\/98612146.html
https:\/\/jobs.51job.com\/shenzhen-lgq\/89000817.html
https:\/\/jobs.51job.com\/shenzhen-baq\/111875926.html
https:\/\/jobs.51job.com\/shenzhen-lhq\/128469423.html
https:\/\/jobs.51job.com\/shenzhen-nsq\/127621564.html
https:\/\/jobs.51job.com\/shenzhen-gmxq\/128468505.html
https:\/\/jobs.51job.com\/shenzhen\/94832755.html
https:\/\/jobs.51job.com\/shenzhen\/86501716.html
https:\/\/jobs.51job.com\/shenzhen\/118814388.html
https:\/\/jobs.51job.com\/shenzhen-nsq\/112284360.html
https:\/\/jobs.51job.com\/shenzhen-baq\/126113504.html
https:\/\/jobs.51job.com\/shenzhen-baq\/128196353.html
https:\/\/jobs.51job.com\/shenzhen-baq\/128462520.html
https:\/\/jobs.51job.com\/shenzhen\/113151196.html
https:\/\/jobs.51job.com\/shenzhen-gmxq\/128461867.html
https:\/\/jobs.51job.com\/shenzhen-baq\/121181152.html
https:\/\/jobs.51job.com\/shenzhen-baq\/120895335.html
https:\/\/jobs.51job.com\/shenzhen-lgq\/70668631.html
https:\/\/jobs.51job.com\/shenzhen-lgq\/122287595.html
https:\/\/jobs.51job.com\/shenzhen-lhq\/128455935.html
https:\/\/jobs.51job.com\/shenzhen-gmxq\/128454633.html
https:\/\/jobs.51job.com\/shenzhen\/119779359.html
https:\/\/jobs.51job.com\/shenzhen-gmxq\/127985104.html
https:\/\/jobs.51job.com\/shenzhen-nsq\/108765058.html
https:\/\/jobs.51job.com\/shenzhen-ftq\/127001417.html
https:\/\/jobs.51job.com\/shenzhen-baq\/91560506.html
https:\/\/jobs.51job.com\/shenzhen-baq\/123460598.html
https:\/\/jobs.51job.com\/shenzhen-baq\/128447465.html
https:\/\/jobs.51job.com\/shenzhen-baq\/128283391.html
https:\/\/jobs.51job.com\/shenzhen-nsq\/107229838.html
https:\/\/jobs.51job.com\/shenzhen-lgq\/127608694.html
https:\/\/jobs.51job.com\/shenzhen-baq\/50598785.html
https:\/\/jobs.51job.com\/shenzhen\/128447178.html
https:\/\/jobs.51job.com\/shenzhen\/126241875.html
https:\/\/jobs.51job.com\/shenzhen-baq\/112350788.html
https:\/\/jobs.51job.com\/shenzhen-baq\/127956616.html
https:\/\/jobs.51job.com\/shenzhen-baq\/122676300.html
https:\/\/jobs.51job.com\/shenzhen-nsq\/127548761.html
https:\/\/jobs.51job.com\/shenzhen-ytq\/128427485.html
https:\/\/jobs.51job.com\/shenzhen-lhq\/117398149.html
https:\/\/jobs.51job.com\/shenzhen-lgq\/128437898.html
https:\/\/jobs.51job.com\/shenzhen-baq\/124169632.html
https:\/\/jobs.51job.com\/shenzhen-ftq\/123363723.html
https:\/\/jobs.51job.com\/shenzhen-lgq\/111643941.html
https:\/\/jobs.51job.com\/shenzhen-nsq\/125295357.html
https:\/\/jobs.51job.com\/shenzhen-ytq\/128000913.html
https:\/\/jobs.51job.com\/shenzhen-lhq\/128257612.html
https:\/\/jobs.51job.com\/shenzhen-lhq\/128441568.html
Process finished with exit code 0