python写的的简单的爬虫小程序
2015-05-17 16:33
211 查看
import re import urllib def getHtml(url): page=urllib.urlopen(url) html=page.read() return html def getpic(html): s=r'src="(.*?\.jpg)" pic_ext' reg=re.compile(s) #这句可有可无 piclist=re.findall(reg,html) x=0 for imgurl in piclist: urllib.urlretrieve(imgurl,'%d.jpg'%x) x=x+1 html=getHtml('http://tieba.baidu.com/p/3216903619') getpic(html)
相关文章推荐
- python简单网络爬虫程序
- 一个简单的python爬虫程序 爬取豆瓣热度Top100以内的电影信息
- Python 简单爬虫程序 以及 urllib.urlretrieve()方法 改变文件存放文件位置
- python简单的爬虫程序
- 一个简单的爬虫程序(爬取百度百科关于python的一千个页面)
- 用 python 做简单的网页爬虫程序
- python-08:理解最简单的爬虫程序
- 用 python 做简单的网页爬虫程序
- python简单爬虫程序
- 一个简单的python爬虫程序
- 一个简单的python爬虫程序
- python-07:最简单的爬虫程序
- 简单的Python爬虫程序
- 一段简单的 Python 爬虫程序
- python3爬虫攻略(4):简单的翻译程序
- 史上最简单的爬虫小程序(Python)
- linux下用python写简单的爬虫程序
- Python 学习(6)---简单的网页爬虫程序
- 简单的Python爬虫刷访问量程序
- python学习笔记:"爬虫+有道词典"实现一个简单的英译汉程序