资源简介
python爬虫,比较基础,适合初学者,Main.py里的初始URL可以更换成你想要挖掘的网站
代码片段和文件信息
import urllib2
class HtmlDownloader(object):
def download(self url):
if url is None:
return None
response = urllib2.urlopen(url)
if response.getcode() != 200:
return None
return response.read()
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-10-06 15:17 python爬虫\
文件 272 2017-10-05 00:22 python爬虫\html_downloader.py
文件 678 2017-10-05 00:22 python爬虫\html_downloader.pyc
文件 784 2017-10-06 11:28 python爬虫\html_outputer.py
文件 1371 2017-10-06 11:28 python爬虫\html_outputer.pyc
文件 1235 2017-10-06 11:48 python爬虫\html_parser.py
文件 1714 2017-10-06 11:49 python爬虫\html_parser.pyc
文件 1173 2017-10-06 11:54 python爬虫\Main.py
文件 475449 2017-10-06 12:06 python爬虫\output.html
文件 724 2017-10-04 23:52 python爬虫\url_manager.py
文件 1497 2017-10-04 23:53 python爬虫\url_manager.pyc
评论
共有 条评论