• 大小: 0M
    文件类型: .py
    金币: 1
    下载: 0 次
    发布日期: 2021-05-13
  • 语言: Python
  • 标签: 其他  

资源简介

51Job.py

资源截图

代码片段和文件信息

#先导入爬取数据所需的库
import urllib.request as ur#用于网页数据获取
import re#正则匹配网页数据中所需的数据
import xlwt#将获取的数据保存为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

评论

共有 条评论