- 博客(4)
- 收藏
- 关注
原创 题目8 爬取某学校官网通告前三页爬虫代码
importrequests fromlxmlimportetree url="http://www.sjzevc.com/index.php?m=content&c=index&a=lists&catid=45&page={}" headers="Mozilla/5.0(WindowsNT6.1;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/80.0.3987.132Safari/537...
2021-06-08 23:32:23 314
原创 题目6 爬取某学校官网通告前三页爬虫代码
importrequests frombs4importBeautifulSoup aa=[] foriinrange(0,3): url="http://www.czvtc.edu.cn/4/20*{i}" resp=requests.get(url) resp.encoding="utf-8" root=BeautifulSoup(resp.text,'lxml') forliinroot.find_all("div",class_="l...
2021-06-08 23:26:58 191
原创 题目9 (第二种方法)爬取某学校官网通告前三页爬虫代码
importrequests fromlxmlimportetree url="http://www.jscvc.cn/242/list{}.htm" headers="Mozilla/5.0(WindowsNT10.0;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/91.0.4472.77Safari/537.36Edg/91.0.864.41" foriinrange(1,4): resp=reque...
2021-06-08 23:21:53 230
原创 题目9 爬取某学校官网通告前三页爬虫代码
importrequests fromlxmlimportetree foriinrange(1,4): resp=requests.get(f'http://www.jscvc.cn/242/list{i}.htm') resp.encoding="utf-8" page_text=etree.HTML(resp.text) li_list=page_text.xpath('//*[@id="wp_news_w9"]/a') forliinli_...
2021-06-08 22:51:49 286
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人