符合自己的工作难找?取招聘网站数据,让你找到心仪的工作

tech2023-10-01  88

前言

现在的招聘网站很多,比如:拉勾网、Boss直聘、智联招聘、前程无忧等。那么多的网站,如何才能在众多招聘信息中找到符合自己的,或者说工作的相关要求。

受难目标

地址

https://search.51job.com/list/010000%252c020000%252c030200%252c040000,000000,0000,00,9,99,python,2,{}.html

 

部分爬虫代码

导入工具

import requests import parsel import re import json import time

请求网页,爬取数据

for page in range(1, 11): url = 'https://search.51job.com/list/010000%252c020000%252c030200%252c040000,000000,0000,00,9,99,python,2,{}.html'.format(page) params = { 'lang': 'c', 'postchannel': '0000', 'workyear': '99', 'cotype': '99', 'degreefrom': '99', 'jobterm': '99', 'companysize': '99', 'ord_field': '0', 'dibiaoid': '0', 'line': '', 'welfare': '', } cookies = { 'Cookie': 'guid=b672753be2ff4b5c3694a1ff805e8c1b; 51job=cenglish%3D0%26%7C%26; nsearch=jobarea%3D%26%7C%26ord_field%3D%26%7C%26recentSearch0%3D%26%7C%26recentSearch1%3D%26%7C%26recentSearch2%3D%26%7C%26recentSearch3%3D%26%7C%26recentSearch4%3D%26%7C%26collapse_expansion%3D; search=jobarea%7E%60190200%7C%21ord_field%7E%600%7C%21recentSearch0%7E%60190200%A1%FB%A1%FA000000%A1%FB%A1%FA0000%A1%FB%A1%FA00%A1%FB%A1%FA99%A1%FB%A1%FA%A1%FB%A1%FA99%A1%FB%A1%FA99%A1%FB%A1%FA99%A1%FB%A1%FA99%A1%FB%A1%FA9%A1%FB%A1%FA99%A1%FB%A1%FA%A1%FB%A1%FA0%A1%FB%A1%FApython%A1%FB%A1%FA2%A1%FB%A1%FA1%7C%21' } headers = { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 'Host': 'search.51job.com', 'Referer': 'https://search.51job.com/list/190200,000000,0000,00,9,99,python,2,1.html?lang=c&postchannel=0000&workyear=99&cotype=99°reefrom=99&jobterm=99&companysize=99&ord_field=0&dibiaoid=0&line=&welfare=', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36', } response = requests.get(url=url, params=params, headers=headers, cookies=cookies) response.encoding = response.apparent_encoding # 想要完整源码的同学可以关注我的公众号:松鼠爱吃饼干 # 回复“51job”即可免费获取

运行代码,效果如下

TXT格式

 

CSV格式

 

我们还可以用词云图来现实招聘的需求

部分词云代码

import jieba import wordcloud import imageio import re py = imageio.imread("python.png") f = open('python招聘信息.txt', encoding='utf-8') re_txt = f.read() # result = re.findall(r'[a-zA-Z]+', re_txt) # txt = ' '.join(result) # jiabe 分词 分割词汇 txt_list = jieba.lcut(re_txt) string = ' '.join(txt_list) # 给词云输入文字 wc.generate(string) # 词云图保存图片地址 wc.to_file(r'python招聘信息.png') # 想要完整源码的同学可以关注我的公众号:松鼠爱吃饼干 # 回复“51job词云”即可免费获取

 

 

从词云图看来,需求还蛮多的

下次想看爬什么网站,可以发在评论区(太难的就算了,我还是个小菜鸡)

最新回复(0)