![](https://img-blog.csdnimg.cn/direct/289545559e8e4169b3695b5a7abfa207.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
Python网络爬虫
0基础网络爬虫
笔记
Bio Coder
这个作者很懒,什么都没留下…
展开
-
Python 利用BeautifulSoup和正则表达式 来爬取旅游网数据
import reimport requestsimport timefrom bs4 import BeautifulSoupurl = ‘http://www.cntour.cn/’r = requests.get(url)print(r.encoding,len(r.text))soup = BeautifulSoup(r.text, ‘lxml’)data = soup.s...原创 2018-11-09 21:49:23 · 447 阅读 · 0 评论 -
Python批量爬取堆糖网图片
import urllib.parseimport requests #第三方请求库import json import jsonpath #处理json文件的的提取库from bs4 import BeautifulSoupimport osimport urllibimport re label = 'AI'label = urllib.parse.quo...翻译 2018-11-11 11:30:27 · 623 阅读 · 2 评论 -
利用Python批量爬取XKCD动漫图片,并批量保存
import requests, os, bs4url = ‘https://xkcd.com’os.makedirs(‘xkcd’,exist_ok = True)while not url.endswith(’#’):# download the pageprint('downloading the %s...'%(url)) # '%s...'%(url)对字符串及进行替换re...翻译 2018-11-10 16:37:36 · 446 阅读 · 0 评论