爬取应届生
import csv
import requests
from lxml import etree
from nonebot import on_command, CommandSession
#创建csv
f=open('result1111_qita3.csv','w',encoding='utf-8',newline='')
csv_writer = csv.writer(f)
csv_writer.writerow(["详情网址","公司名称","职位名称","工作地点","信息来源","时间"])
getstring='http://www.yingjiesheng.com/other-morejob-1.html'
r=requests.get(getstring)
r.encoding = 'gbk'
html = etree.HTML(r.text)
html_text=html.xpath('/html/body/div[4]/div/div[2]/div[1]/p/span[1]/text()')#数组
pagenum=int(int(html_text[0][1:][:-1])/150)#一页150条
getstring='http://www.yingjiesheng.com/other-morejob-1.html'
r=requests.get(getstring)
r.encoding = 'gbk'
html = etree.HTML(r.text)
html_url_dic=html.xpath('//*[@class="jobli"]/td[1]/a/@href')
html_name_dic=html.x