- 博客(2)
- 收藏
- 关注
转载 Python中运用正则表达式抓取网页图片
#!/usr/bin/pythonimport reimport urllib#获取网页信息def getHtml(url): page = urllib.urlopen(url) html = page.read() return htmldef getImg(html):#匹配网页中的图片 reg = r'src="(.*?\
2015-09-23 21:43:55 3210
原创 Python抓取新闻标题和链接
#-*-coding:utf-8-*-import refrom urllib import urlretrieve from urllib import urlopen #获取网页信息doc = urlopen("http://www.itongji.cn/news/").read() #抓取新闻标题和链接def extract_title(info):
2015-09-23 21:23:00 3559
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人