python 爬虫,python,学习python就一直想
python 爬虫,python,学习python就一直想
学习python就一直想做爬虫的东西,还要继续学
理论上的东西一要加强
#!/usr/bin/python#coding=utf-8import urllibimport redef getHtml(url): page = urllib.urlopen(url) html = page.read() return htmldef getImg(html): reg = r'src="(.+?\.jpg)" pic_ext' imgre = re.compile(reg) imglist = re.findall(imgre,html) x = 0 for imgurl in imglist: urllib.urlretrieve(imgurl,'%s.jpg' % x) x+=1html = getHtml("http://tieba.baidu.com/p/3102805968")print getImg(html)
爬到的图片
相关内容
- Djano发送邮件,,转自:https://d
- Python 中使用 MongoDB 存储爬虫数据,pythonmongodb,现在在做
- python实现将文本转换成语音的方法,python语音,# Text T
- 情人节的颤抖,情人节颤抖,#! /usr/bin/
- 查询oralce数据库返回数据字典,oralce字典, def sqlD
- 自己用python随意写的12306订票代码,python12306,None
- python 电话本管理例子,python例子,#!/usr/bin/e
- 将100以内的质数挑选出来,100质数挑选出来,"""使用
- python、bash猜数字游戏,pythonbash猜数字,#!/bin/bashN
- 抓取tuigirl图片,抓取tuigirl,import urlli
评论关闭