摘要: 在目录下创建tools(python package) 在tools中创建crawl_xici_ip.py文件写入代码如下: 在middlewares.py中添加代码如下: 在settings.py中配置 阅读全文
posted @ 2017-07-11 15:29 hcw_19 阅读(4080) 评论(1) 推荐(0) 编辑
摘要: 环境:python3 爬取网址:腾讯社招(http://hr.tencent.com/position.php?keywords=&tid=0&start=0#a)总共2202条数据 pipelines.py items.py settings.py spiders/Tencent.py 阅读全文
posted @ 2017-07-04 15:30 hcw_19 阅读(4627) 评论(0) 推荐(0) 编辑
摘要: 自己的案列:win7上安装ubuntu (win7作为slaver,ubuntu作为master ) 修改配置文件redis.conf 1)打开配置文件把下面对应的注释掉# bind 127.0.0.1 2)Redis默认不是以守护进程的方式运行,可以通过该配置项修改,设置为nodaemonize 阅读全文
posted @ 2017-06-22 17:31 hcw_19 阅读(4155) 评论(0) 推荐(0) 编辑
摘要: 爬取微信热门文章标题,内容,内容地址,微信公众号,公众号地址,发布日期等 如图 源码地址:https://github.com/huwei86/sougouweixin 阅读全文
posted @ 2017-06-21 12:37 hcw_19 阅读(532) 评论(0) 推荐(0) 编辑
摘要: 爬取融资公司,融资公司简介,融资时间,轮次,融资额,投资方,股权占比以及融资公司完整融资历史 如图 源码地址:https://github.com/huwei86/spiderITjuzi 阅读全文
posted @ 2017-06-21 12:02 hcw_19 阅读(1290) 评论(1) 推荐(0) 编辑
摘要: 在手机端打开慕课网,fiddler查看如图注意圈起来的位置 经过分析只有画线的page在变化 上代码: items.py 1 import scrapy 2 3 4 class ImoocItem(scrapy.Item): 5 # define the fields for your item h 阅读全文
posted @ 2017-06-16 16:23 hcw_19 阅读(4221) 评论(1) 推荐(0) 编辑
摘要: 一般来说爬虫类框架抓取Ajax动态页面都是通过一些第三方的webkit库去手动执行html页面中的js代码, 最后将生产的html代码交给spider分析。本篇文章则是通过利用fiddler抓包获取json数据分析Ajax页面的具体请求内容,找到获取数据的接口url,直接调用该接口获取数据,省去了引 阅读全文
posted @ 2017-06-16 12:52 hcw_19 阅读(2158) 评论(0) 推荐(0) 编辑
摘要: 关于fiddler的使用方法参考(http://jingyan.baidu.com/article/03b2f78c7b6bb05ea237aed2.html) 本案例爬取斗鱼 app 先利用fiddler分析抓包json数据如下图 通过分析发现变化的只有offset 确定item字段 开始编写代码 阅读全文
posted @ 2017-06-12 17:17 hcw_19 阅读(624) 评论(0) 推荐(0) 编辑
摘要: 在当前目录中新建文件保存为(删除git信息.bat)在其写入:for /r . %%a in (.) do @if exist "%%a\.git" rd /s /q "%%a\.git" 点击运行即可 运行之前 点击运行之后: 阅读全文
posted @ 2017-06-11 16:37 hcw_19 阅读(3255) 评论(0) 推荐(0) 编辑
摘要: items.py 1 # -*- coding: utf-8 -*- 2 3 # Define here the models for your scraped items 4 # 5 # See documentation in: 6 # http://doc.scrapy.org/en/late 阅读全文
posted @ 2017-06-11 16:14 hcw_19 阅读(506) 评论(0) 推荐(0) 编辑