python 3 网络爬取图片之二
2017-01-12 16:56
162 查看
import webbrowser, requests, bs4, re, os url = "https://www.sogou.com" res = requests.get(url) soup = bs4.BeautifulSoup(res.text, "html.parser") img = soup.select('img') comicUrl = img[0].get('src') imageFile = open(os.path.join('c:\\u', os.path.basename(comicUrl)), 'wb') res1 = requests.get(url+comicUrl) for chunk in res.iter_content(100000): imageFile.write(chunk) imageFile.close()
相关文章推荐
- (已加马赛克)10 行代码判定色*情*图片——Python 也可以系列之二
- 10 行代码判定色*情*图片——Python 也可以系列之二 (转载)
- selenium+python 爬取网络图片(1) -- soso、谷歌、好搜
- python从网络读取图片并直接进行处理的方法
- python使用PIL缩放网络图片并保存的方法
- (已加马赛克)10 行代码判定色*情*图片——Python 也可以系列之二
- Android异步加载学习笔记之二:实现ListView中的图片数据从网络加载
- Python爬取网络图片
- 用python调用七牛的fetch接口保存网络上的图片
- python 网络爬虫抓取图片
- python3.2从网络中下载一张图片
- android中图片的三级cache策略(内存、文件、网络)之二:内存缓存策略
- android中图片的三级cache策略(内存、文件、网络)之二:内存缓存策略
- 一张图作为Python入门(图片来自网络)
- Python -- 网络编程 -- 抓取网页图片 -- 图虫网
- (已加马赛克)10 行代码判定色*情*图片——Python 也可以系列之二
- android中图片的三级cache策略(内存、文件、网络)之二:内存缓存策略
- android中图片的三级cache策略(内存、文件、网络)之二:内存缓存策略
- android中图片的三级cache策略(内存、文件、网络)之二:内存缓存策略
- Python爬虫之抓取网络图片