文章分类 -  爬虫

摘要:参考地址: celery 分布式爬虫 https://www.jianshu.com/p/e5539d96641c https://github.com/SpiderClub/weibospider 分布式、增量爬虫:https://www.cnblogs.com/zhangqing979797/p 阅读全文
posted @ 2019-05-21 14:54 逐梦客! 阅读(159) 评论(0) 推荐(0) 编辑
摘要:首页 | 正则表达式30分钟入门教程 | 常用正则表达式| 正则表达式速查表 | 正则表达式测试工具 | 正则表达式 | JavaScript正则在线测试工具(带高亮) | JavaScript正则在线测试工具 | 正则练习器在线 转自:https://www.jb51.net/tools/zhen 阅读全文
posted @ 2018-09-13 20:13 逐梦客! 阅读(172) 评论(0) 推荐(0) 编辑
摘要:登录 import scrapy from scrapy.http import request class RenRen(scrapy.Spider): """主要测试登录""" name = 'renren' allowed_domains = ['renren.com'] start_urls 阅读全文
posted @ 2018-09-11 11:12 逐梦客! 阅读(213) 评论(0) 推荐(0) 编辑
摘要:shell Syntax: scrapy shell [url] Requires project: no Starts the Scrapy shell for the given URL (if given) or empty if no URL is given. Also supports 阅读全文
posted @ 2018-09-10 15:59 逐梦客! 阅读(333) 评论(0) 推荐(0) 编辑
摘要:笔者编写的搜索引擎爬虫在爬取页面时遇到了网页被重定向的情况,所谓重定向(Redirect)就是通过各种方法(本文提到的为3种)将各种网络请求重新转到其它位置(URL)。每个网站主页是网站资源的入口,当重定向发生在网站主页时,如果不能正确处理就很有可能会错失这整个网站的内容。 笔者编写的爬虫在爬取网页 阅读全文
posted @ 2018-09-10 11:55 逐梦客! 阅读(14515) 评论(0) 推荐(0) 编辑
摘要:Response Request Handler Cookie cookie保存到文件 # 火狐浏览器保存模式 filename = "cookie.txt" cookie = http.cookiejar.MozillaCookieJar(filename) handler = urllib.re 阅读全文
posted @ 2018-09-09 14:35 逐梦客! 阅读(137) 评论(0) 推荐(0) 编辑
摘要:Requests 是用Python语言编写,基于 urllib,采用 Apache2 Licensed 开源协议的 HTTP 库。它比 urllib 更加方便,可以节约我们大量的工作,完全满足 HTTP 测试需求。Requests 的哲学是以 PEP 20 的习语为中心开发的,所以它比 urllib 阅读全文
posted @ 2018-09-05 19:38 逐梦客! 阅读(1397) 评论(0) 推荐(0) 编辑
摘要:Selenium中文网:http://www.selenium.org.cn/ Selenium文档:https://selenium-python.readthedocs.io/getting-started.html 搭建环境 Windows 10 Python3.6 Selenium 3.8. 阅读全文
posted @ 2018-09-05 11:10 逐梦客! 阅读(302) 评论(0) 推荐(0) 编辑
摘要:环境搭建 本次爬去糗事百科,爬取地址:http://www.qiushibaike.com/8hr/page/1/ python3 代码示例 import requests import threading from queue import Queue from lxml import etree 阅读全文
posted @ 2018-09-04 19:10 逐梦客! 阅读(243) 评论(0) 推荐(0) 编辑
摘要:lxml官网:https://lxml.de/ 目前有很多xml,html文档的parser,如标准库的xml.etree , beautifulsoup , 还有lxml. 都用下来感觉lxml不错,速度也还行,就他了. 围绕三个问题: 问题1:有一个XML文件,如何解析 问题2:解析后,如果查找 阅读全文
posted @ 2018-09-04 15:52 逐梦客! 阅读(547) 评论(0) 推荐(0) 编辑
摘要:一、选取节点 常用的路劲表达式: 二、谓语 谓语被嵌在方括号内,用来查找某个特定的节点或包含某个制定的值的节点 实例: 三、通配符 Xpath通过通配符来选取未知的XML元素 四、取多个路径 使用“|”运算符可以选取多个路径 五、Xpath轴 轴可以定义相对于当前节点的节点集 六、功能函数 使用功能 阅读全文
posted @ 2018-09-04 14:25 逐梦客! 阅读(90) 评论(0) 推荐(0) 编辑
摘要:Github:https://github.com/json-path/JsonPath 文档:http://goessner.net/articles/JsonPath/ python jsonpath:https://pypi.org/project/jsonpath/#files 安装命令: 阅读全文
posted @ 2018-09-04 12:56 逐梦客! 阅读(490) 评论(0) 推荐(0) 编辑
摘要:开发文档:https://urllib3.readthedocs.io/en/latest/ 阅读全文
posted @ 2018-09-03 10:23 逐梦客! 阅读(97) 评论(0) 推荐(0) 编辑
摘要:Scrapy下载地址: 官网:https://scrapy.org/ GitHub:https://github.com/scrapy/scrapy 获取Scrapy Document 从GitHub下载scrapy 进入scrapy-master\docs,按README.rst生成Scrapy 阅读全文
posted @ 2018-08-14 15:27 逐梦客! 阅读(141) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示