Python爬虫初试
来源:互联网 发布:软件开发项目建议书 编辑:程序博客网 时间:2024/06/04 19:39
#coding=utf-8import urllib.requestimport redef getHtml(url): page = urllib.request.urlopen(url) html = page.read() html = html.decode('utf-8') return htmldef getImg(html): reg = r'src="(.+?\.jpg)" pic_ext' imgre = re.compile(reg) imglist = imgre.findall(html) x = 0 for imgurl in imglist: urllib.request.urlretrieve(imgurl,'D:\jpg\%s.jpg' % x) x+=1 print(x)html = getHtml("http://tieba.baidu.com/p/2460150866")getImg(html)
0 0
- python爬虫初试
- Python爬虫初试
- Python 网络爬虫 初试
- python 爬虫初试
- Python网络爬虫2 ---- scrapy爬虫架构介绍和初试
- 【简易Python爬虫】 初试爬虫_简易Python图片爬虫实现
- python初试
- Python3爬虫之一初试
- 网络爬虫初试
- 初试网络爬虫(1)
- 初试scrapy编写twitter爬虫
- C++调用Python初试
- Python与Selenium初试
- 初试python网络通信
- 初试 爬虫机器人 + luence全文检索
- scrapy爬虫架构介绍和初试
- Scrapy爬虫框架(一):初试牛刀
- 初试CGI编程--python篇
- 使用此Adapter,代码量可大大减少
- C# XML
- nginx模块开发0(hello world)
- 2016-2017 ACM-ICPC, NEERC, Southern Subregional Contest - J. Bottles(DP)
- android开发视频
- Python爬虫初试
- 299. Bulls and Cows
- 乐pro3(lex720)评测
- 阿里云ECS下安装jdk1.8
- Taglib标签之六Taglib中常用的属性值与tld常用标签简介与web.xml设置自定义标签的uri
- Android性能优化系列之apk瘦身
- 1013. Battle Over Cities
- IT漫谈 - 大数据已悄然进入我们的生活
- 关于ios签名机制的理解