zhaopin D.Users 7 Aimport 1ogging
venv 8
foceshi.py 9 warnings.filterwarnings(“ignore”)
datal.csv 10
odatal.xls 11 foriinrange(1,2):
ademo.py 12 #print(正在收第+str(i).+“页的数据)
demol.py 13 urlpre=“https://search.51job.com/1ist/000000,000000,0000,00,9,99,%25E6%2595%25B0%25E6%258D%25AE,2,
demo3.py 14 url_end=“.htm1?
wuyou.xls 15 url=url pre+str(i)+url_end
遇招聘.cSv 16 headers=t
OScratches and Col 17
User-Agent:Mozi11a/5.0(Windows NT10.0;Win64;x64)ApplellebKit/537.36(KHTML,1ike Gecko)Chrome/73.0.3683.86 Safari/537.36
山外部库 18
19 web=requests.get(url,headers=headers)
20 web.encoding=“gbk
21 dom=etree.HTML(web.text)
22 #1、阅位名称
23 job name=dom.xpath('/div[@class=j_joblist”]/div[@class=e”]/a[@class=”e1”]/p[@class="t”]/span[@class=”jname at”]/@title)
24 print(jobname)
25 #2、公司名称
26 company_name=dom.xpath('//div[@class=”j_joblist"]/div[eclass=”e"]/div[@class="er"]/a[@target=”_blank"]/@title’
27 print(companv name)
foriinrange(1,2)
招聘数据完整代码
个 C:\Users13633AppData\Local\Programs\Python\Python38python.exe“D:/pythonchengxu/一行02招聘数据和代码/一行02招聘数据和代码/招聘数据完整代码.py
[]
L]
数据爬取完毕,是不是很开心!!!