爬虫
来源:互联网 发布:wap站长之家源码 编辑:程序博客网 时间:2024/05/22 06:50
#!/usr/bin/env python#coding=utf-8import reimport urllibdef getHtml(url): page = urllib.urlopen(url) html = page.read() return htmldef getImg(html): reg = r'src="(.+\.png)"' imgre = re.compile(reg) imglist = re.findall(imgre,html) x = 1 for imgurl in imglist: urllib.urlretrieve(imgurl,'%s.png' % x) x += 1html = getHtml("http://172.25.254.100")print getImg(html)
0 0
- 爬虫
- 爬虫
- 爬虫
- 爬虫
- 爬虫
- 爬虫
- 爬虫
- 爬虫
- 爬虫
- 爬虫
- 爬虫
- 爬虫
- 爬虫
- 爬虫
- 爬虫
- 爬虫
- 爬虫
- 爬虫
- 面试(五)
- 全局变量让看上去合理的程序出问题
- 自定义的UI里永远不要写任何有关数据的东西,全放到UIViewController里
- Android 桌面角标在各大品牌机型上的实现
- STM32F4使用FreeRTOS的中断
- 爬虫
- SetActive();和Destroy();两个函数对脚本中函数的不同的影响
- android.intent.action大全和用法收集
- UVA 230
- 对于Python中if __name__=='__main__' 的理解
- 高性能Nginx服务器优化实战
- sharding jdbc--Cloud not resolve placeholder … in string value …?
- 数据库<2>
- Dropout solve overfitting