摘要: # -*- coding:utf8 -*-#import urllib.request#url =' http://www.douban.com/'#webPage=urllib.request.urlopen(url)#data = webPage.read()#data = data.decod 阅读全文
posted @ 2017-03-22 15:59 哪啊哪啊神去村 阅读(519) 评论(0) 推荐(0) 编辑
摘要: 下载地址:https://www.crummy.com/software/BeautifulSoup/bs4/download/4.5/ 安装成功,亲测可用! 参考文章http://blog.csdn.net/caimouse/article/details/51659155 Beautiful S 阅读全文
posted @ 2017-03-22 15:42 哪啊哪啊神去村 阅读(1446) 评论(0) 推荐(0) 编辑
摘要: 1、url= http://www.mzitu.com/74100/x,2为1到23的值 2、用到模块 os 创建文件目录; re模块正则匹配目录名 图片下载地址; time模块 限制下载时间;requests模块获取网页源代码;urllib模块 urllib.urlretrieve(图片url,保 阅读全文
posted @ 2017-03-22 10:38 哪啊哪啊神去村 阅读(2237) 评论(0) 推荐(0) 编辑
摘要: import re import urllib.request # 爬取网页 def getHtml(url): page=urllib.request.urlopen(url) html=page.read() return html # 获取图片地址 def getImg(html): rule=r'src="(.*?\.jpg)" width' ru... 阅读全文
posted @ 2017-03-22 10:25 哪啊哪啊神去村 阅读(1700) 评论(0) 推荐(0) 编辑