<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
        問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
        當(dāng)前位置: 首頁 - 科技 - 知識百科 - 正文

        Python獲取趕集網(wǎng)招聘信息的方法

        來源:懂視網(wǎng) 責(zé)編:小OO 時間:2020-11-27 14:25:59
        文檔

        Python獲取趕集網(wǎng)招聘信息的方法

        如何獲取一個網(wǎng)站的相關(guān)信息,獲取趕集網(wǎng)的招聘信息,本文為大家介紹利用python獲取趕集網(wǎng)招聘信息的關(guān)鍵代碼,供大家參考,具體內(nèi)容如下:,import reimport urllibimport urllib.request#獲取趕集網(wǎng)數(shù)據(jù)def begin(url): #要偽裝成的瀏覽器(我這個是用的chrome) headers = (';User-Agent';,返回字典城市對應(yīng)城市的urldef get_cityinfo(data): city_info1=re.findall(r';dl>;(.*?)<;/dl>;';,data,city_info1[0],each,each,data[0],each,each,cdzp_info,each。
        推薦度:
        導(dǎo)讀如何獲取一個網(wǎng)站的相關(guān)信息,獲取趕集網(wǎng)的招聘信息,本文為大家介紹利用python獲取趕集網(wǎng)招聘信息的關(guān)鍵代碼,供大家參考,具體內(nèi)容如下:,import reimport urllibimport urllib.request#獲取趕集網(wǎng)數(shù)據(jù)def begin(url): #要偽裝成的瀏覽器(我這個是用的chrome) headers = (';User-Agent';,返回字典城市對應(yīng)城市的urldef get_cityinfo(data): city_info1=re.findall(r';dl>;(.*?)<;/dl>;';,data,city_info1[0],each,each,data[0],each,each,cdzp_info,each。

        這篇文章主要為大家分享了如何利用Python獲取趕集網(wǎng)招聘信息的前一篇內(nèi)容,感興趣的小伙伴們可以參考一下

        如何獲取一個網(wǎng)站的相關(guān)信息,獲取趕集網(wǎng)的招聘信息,本文為大家介紹利用python獲取趕集網(wǎng)招聘信息的關(guān)鍵代碼,供大家參考,具體內(nèi)容如下

        import re
        import urllib
        import urllib.request
        #獲取趕集網(wǎng)數(shù)據(jù)
        def begin(url):
         #要偽裝成的瀏覽器(我這個是用的chrome)
         headers = ('User-Agent','Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36')
         opener = urllib.request.build_opener()
         #將要偽裝成的瀏覽器添加到對應(yīng)的http頭部
         opener.addheaders=[headers]
         #讀取相應(yīng)的url
         data = opener.open(url).read()
         #將獲得的html解碼為utf-8
         data=data.decode('utf-8')
         return data
        #處理數(shù)據(jù),返回字典城市對應(yīng)城市的url
        def get_cityinfo(data):
         city_info1=re.findall(r'dl>(.*?)</dl>',data,re.S)
         city_info2=re.findall(r'(<a.*?</a>)',city_info1[0],re.S)
         city_dict={}
         for each in city_info2:
         key=re.findall('>(.*?)</',each,re.S)
         city_url=re.findall('href="(.*?)"',each,re.S)
         city_dict[key[0]]=city_url[0]
         return city_dict
        #獲取所有的a標(biāo)簽,并從a標(biāo)簽中獲取信息
        def a_info(data):
         a_info=re.findall(r'(<a.*?</a>)',data[0],re.S)
         a_dict={}
         for each in a_info:
         key=re.findall('>(.*?)</',each,re.S)
         a_url=re.findall('"(.*?)"',each,re.S)
         a_dict[key[0]]=a_url[0]
         return a_dict
        #獲取對應(yīng)城市信息的所有分類
        def get_cityinfoclass():
         #目前先獲取招聘信息,后面有時間再繼續(xù)補充完善這個模塊
         info= 'zhaopin/'
         return info
        #獲取對應(yīng)城市和其城市分類的信息
        def getzhaopin(city_info,infoclass):
         #先搞成都的信息招聘
         city_url=city_info['成都']
         cdzp_url=city_url+infoclass
         cdzp_info=begin(cdzp_url)
         return city_url,cdzp_info
        #獲取成都市招聘信息
        def get_zhaopin_info(city_url,cdzp_info):
         allzp_info=re.findall('class="f-all-news"(.*?)</p>',cdzp_info,re.S)
         a_dict={}
         class_info=re.findall('<dd>(.*?)</dd>',allzp_info[0],re.S)
         for each in class_info:
         a_info=re.findall(r'(<a.*?</a>)',each,re.S)
         for each1 in a_info:
         key=re.findall('>(.*?)</',each1,re.S)
         a_url=re.findall('href="/(.*?)"',each1,re.S)
         a_dict[key[0].strip()]=city_url+a_url[0]
         return a_dict
        #獲取招聘信息的具體內(nèi)容
        def get_city_zpinfo_detail(url):
         #先獲取軟件工程師
         sorft_engineer=(zp_class_info['軟件工程師'])
         job_url_info=begin(sorft_engineer)
         get_detail_info(job_url_info)
        #處理詳情頁的信息
        def get_detail_info(list_info):
         job_info=re.findall('<dl class="list-noimg job-list clearfix"(.*?)</dl',list_info,re.S)
         print(job_info[0])
        if __name__=='__main__':
         url='http://www.ganji.com/index.htm';
         data=begin(url);
         #所有城市信息
         city_info=get_cityinfo(data)
         #對應(yīng)的分類
         infoclass=get_cityinfoclass()
         cdzp_url,xiaoshou=getzhaopin(city_info,infoclass)
         #獲取招聘的分類信息
         zp_class_info=get_zhaopin_info(cdzp_url,xiaoshou)
         get_city_zpinfo_detail(zp_class_info)

        聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        Python獲取趕集網(wǎng)招聘信息的方法

        如何獲取一個網(wǎng)站的相關(guān)信息,獲取趕集網(wǎng)的招聘信息,本文為大家介紹利用python獲取趕集網(wǎng)招聘信息的關(guān)鍵代碼,供大家參考,具體內(nèi)容如下:,import reimport urllibimport urllib.request#獲取趕集網(wǎng)數(shù)據(jù)def begin(url): #要偽裝成的瀏覽器(我這個是用的chrome) headers = (';User-Agent';,返回字典城市對應(yīng)城市的urldef get_cityinfo(data): city_info1=re.findall(r';dl>;(.*?)<;/dl>;';,data,city_info1[0],each,each,data[0],each,each,cdzp_info,each。
        推薦度:
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 人成电影网在线观看免费| 亚洲国产成人久久三区| 国产成人亚洲精品电影| 免费一本色道久久一区| 亚洲www77777| 精品国产一区二区三区免费看| 精品国产日韩久久亚洲| 精品国产免费观看一区| 人体大胆做受免费视频| 国产av无码专区亚洲av果冻传媒 | 少妇性饥渴无码A区免费| 亚洲人成网7777777国产| 日韩人妻一区二区三区免费| 91嫩草私人成人亚洲影院| 免费大片黄在线观看yw| 亚洲乱妇熟女爽到高潮的片| 四只虎免费永久观看| 久久国产免费直播| 亚洲网站在线免费观看| 毛片网站免费在线观看| 免费毛片毛片网址| 亚洲成AV人片在| 美女视频黄的全免费视频| 国产亚洲午夜精品| 久久亚洲精品国产精品黑人| av大片在线无码免费| 成人在线免费视频| 亚洲精品在线观看视频| 黑人粗长大战亚洲女2021国产精品成人免费视频 | 亚洲宅男精品一区在线观看| 国产乱子影视频上线免费观看| 亚洲精品偷拍视频免费观看| 亚洲国产老鸭窝一区二区三区| 好先生在线观看免费播放 | 菠萝菠萝蜜在线免费视频| 怡红院亚洲怡红院首页| 国产成人无码免费看视频软件| 一级特级aaaa毛片免费观看| 亚洲国产成人精品电影| 亚洲伊人成无码综合网| 桃子视频在线观看高清免费完整|