![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python学习
文章平均质量分 71
mathfinder
这个作者很懒,什么都没留下…
展开
-
python开发爬虫----urllib2下载网页方法
urllib2下载网页方法1:import urllib2#直接请求response = urllib2.urlopen('http://www.baidu.com')#获取状态码,如果返回200则获取成功print response.getcode()#读取内容cont = response.read()urllib2下载网页方法2:添加data http header原创 2016-08-12 19:58:35 · 416 阅读 · 0 评论 -
python开发爬虫---写网络解析器
#coding:utf8from bs4 import BeautifulSoupimport rehtml_doc = """The Dormouse's storyThe Dormouse's storyOnce upon a time there were three little sisters; and their names wereElsie,Lacie and原创 2016-08-12 22:48:01 · 474 阅读 · 0 评论 -
python开发爬虫实例代码
1.创建baike_spider包2.创建调度模块:#coding:utf8from baike_spider import url_manager, html_downloader, html_parser,\ html_outputerclass SpiderMain(object): def __init__(self): self.urls =原创 2016-08-13 13:26:59 · 1326 阅读 · 0 评论