python爬取前程無憂招聘崗位資訊

2021-09-19 15:31:24 字數 956 閱讀 6274

######################首先使用requests獲取前程無憂一級網頁

tatal=re.compile('共(.?)頁』).findall(rst)#正則獲取總頁數

tatal=int(tatal[0])

################################獲取二級網頁的url(所有崗位的url) 儲存起來

with open('sh1.txt','a',encoding='utf-8') as f:

for i in ls:

f.write(str(i)+'\n')

f.flush()

print(i)

except exception:

print('失敗')

with open('shibai1.txt','a',ending='utf-8') as s:

s.write(url)

if page < tatal:

page=page +1

else:

break

############################分析獲取到的資訊

with open(『sh1.txt』,『r』,encoding=『utf-8』) as e:#讀取已存url

h.write(rst)

print(『第』+str(n)+『個網頁』)

n=n+1

except exception:

print(『失敗』)

with open(『失敗1.txt』,『a』,encoding=『gbk』) as g:

g.write(str(j)+』\n』)

timeout=10

continue

爬取前程無憂上的招聘資訊

這段時間公司人事部門需要爬取一些崗位資訊下來,利用空閒時間寫了個指令碼下來,如下。usr bin python from bs4 import beautifulsoup import csv import time import random import requests import sys ...

python 爬取智聯招聘

乙個爬取智聯的乙個小爬蟲 python版本 python3.7 依賴模組 selenium pyquery 廢話少說,上 from selenium import webdriver from selenium.webdriver.chrome.options import options from...

使用nodejs爬前程無憂前端技能排行(半半成品)

最近準備換工作,需要更新一下技能樹。為做到有的放矢,想對招聘方的要求做個統計。正好之前了解過nodejs,所以做了個爬蟲搜尋資料。具體步驟 1 先用fiddler分析請求需要的header和body。2 再用superagent構建上述資料傳送客戶端請求。3 最後對返回的資料使用cheerio整理。...