使用简易Python爬虫下载百度贴吧图片
2014-05-21 16:16
741 查看
百度贴吧有贴吧的帖子中有很漂亮的图片,如桌面贴吧有很多适合做系统桌面壁纸的图片,而是用一次一次的下载很是麻烦,所以是用Python写了一个简易的脚本,写的不好,希望大家不要见笑,新手。
Python代码如下:
有问题可以咨询我的SINA微博:@Lyndonneu
Python代码如下:
#!/usr/bin/python import re import urllib def getHtml(url): page=urllib.urlopen(url) html=page.read() return html def getImg(html): reg=r'src="(.*?\.jpg)"' imgre=re.compile(reg) imglist=re.findall(imgre,html) x=0 for imgurl in imglist: urllib.urlretrieve(imgurl,'%s.jpg'%x) x+=1 y=raw_input('Please input your URL:>') html=getHtml(y) getImg(html)
有问题可以咨询我的SINA微博:@Lyndonneu
相关文章推荐
- python scrapy爬虫爬取图片简易方法,使用Images模块
- python中使用网络爬虫下载图片
- 我的第一个python爬虫程序(从百度贴吧自动下载图片)
- python简易爬虫来实现自动图片下载
- python学习:urllib库学习:制作简易爬虫下载图片
- python爬虫:下载百度贴吧图片学习笔记
- Python爬虫urllib2笔记(三)之使用正则表达式提取百度贴吧网页中的楼主发的图片
- python 百度贴吧爬虫(下载图片)
- 使用python进行爬虫下载指定网站的图片
- Python爬虫实战(五) :下载百度贴吧帖子里的所有图片
- Python3网络爬虫:Scrapy入门之使用ImagesPipline下载图片
- Python实现简单爬虫功能--批量下载百度贴吧里的图片
- 【Python】Python简易爬虫爬取百度贴吧图片
- python爬虫:下载百度贴吧图片(多页)学习笔记
- Python爬虫学习记录(1)——百度贴吧图片下载
- 使用Python爬虫爬取妹子图图片
- python爬虫图片下载
- Python中使用Flask、MongoDB搭建简易图片服务器
- Python下载百度贴吧帖子里面的图片
- python 爬虫下载网站图片