資源簡介
51Job.py
代碼片段和文件信息
#先導(dǎo)入爬取數(shù)據(jù)所需的庫
import?urllib.request?as?ur#用于網(wǎng)頁數(shù)據(jù)獲取
import?re#正則匹配網(wǎng)頁數(shù)據(jù)中所需的數(shù)據(jù)
import?xlwt#將獲取的數(shù)據(jù)保存為excel文件
def?get_content(page):#獲取源碼
????url?=?‘http://search.51job.com/list/000000000000000000999%25E6%2599%25BA%25E8%2583%25BD2‘+?str(page)+‘.html‘#智能
????url2?=?‘http://search.51job.com/list/070000000000000000999%25E6%2599%25BA%25E8%2583%25BD2‘+str(page)+‘.html?lang=c&stype=&postchannel=0000&workyear=99&cotype=99°reefrom=99&jobterm=99&companysize=99&providesalary=99&lonlat=0%2C0&radius=-1&ord_field=0&confirmdate=9&fromType=&dibiaoid=0&address=&line=&specialarea=00&from=&welfare=‘
????url3?=?‘http://search.51job.com/list/010000%252C020000%252C030200%252C040000000000000000999%25E6%2599%25BA%25E8%2583%25BD2‘+str(page)+‘.html?lang=c&stype=1&postchannel=0000&workyear=99&cotype=99°reefrom=99&jobterm=99&companysize=99&lonlat=0%2C0&radius=-1&ord_field=0&confirmdate=9&fromType=1&dibiaoid=0&address=&line=&specialarea=00&from=&welfare=‘
????url4?=?‘http://search.51job.com/list/030000000000000000999%25E6%2599%25BA%25E8%2583%25BD2‘+str(page)+‘.html?lang=c&stype=1&postchannel=0000&workyear=99&cotype=99°reefrom=99&jobterm=99&companysize=99&lonlat=0%2C0&radius=-1&ord_field=0&confirmdate=9&fromType=1&dibiaoid=0&address=&line=&specialarea=00&from=&welfare=‘
????url5?=?‘http://search.51job.com/list/030000%252C130000%252C150000%252C160000%252C170000000000000000999%25E6%2599%25BA%25E8%2583%25BD2‘+str(page)+‘.html?lang=c&stype=1&postchannel=0000&workyear=99&cotype=99°reefrom=99&jobterm=99&companysize=99&lonlat=0%2C0&radius=-1&ord_field=0&confirmdate=9&fromType=1&dibiaoid=0&address=&line=&specialarea=00&from=&welfare=‘
????#?url6?=?‘http://search.51job.com/list/200000%252C210000%252C220000%252C230000%252C240000000000000000999%2
評論
共有 條評論