基于关键字在主流搜索引擎中抓取信息

本文首发于我的博客:http://gongyanli.com
代码传送门:https://github.com/Gladysgong/seCrawler
简书: https://www.jianshu.com/p/4e244563849a
CSDN: https://blog.csdn.net/u012052168/article/details/79762586

seCrawler(Search Engine Crawler)

A scrapy project can crawl search result of Google/Bing/Baidu

refer

copying by https://github.com/xtt129/seCrawler and rewrite,adding title and abstract.

prerequisite

python 3.5 and scrapy is needed.

commands

run one command to get 50 pages result from search engine with keyword, the result would be kept in the “urls.txt” under the current directory.

Bing

scrapy crawl keywordSpider -a keyword=Spider-Man -a se=bing -a pages=50

Baidu

scrapy crawl keywordSpider -a keyword=Spider-Man -a se=baidu -a pages=50

Google

scrapy crawl keywordSpider -a keyword=Spider-Man -a se=google -a pages=50

results

url,title and abstract will be stored in the urls.txt

limitation

The project doesn’t provide any workaround to the anti-spider measure like CAPTCHA, IP ban list, etc.

But to reduce these measures, we recommand to set DOWNLOAD_DELAY=10 in settings.py file to add a temporisation (in second) between the crawl of two pages, see details in Scrapy Setting.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值