职友集

python爬虫将职友集招聘信息爬取后存入excle中

瘦欲@ 提交于 2020-02-02 05:05:43
导入爬虫库 import requests from bs4 import BeautifulSoup 导入操作excle的库 import xlwt import xlrd import xlutils 网页页面 代码 import requests from bs4 import BeautifulSoup import xlwt import xlrd import xlutils #得到excle对象 book = xlwt . Workbook ( ) sheet = book . add_sheet ( 'sheet1' ) listall = [ ] #用于存储爬去的职位名称和薪资 #爬取1到29页所有的信息 for i in range ( 1 , 30 ) : URL = 'https://www.jobui.com/jobs?jobKw=linux&cityKw=%E5%8C%97%E4%BA%AC&n=' + str ( i ) #wb_data = requests.get(URL) headers = { 'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari