项目作者: jasonGeng88

项目描述 :
基于scrapy+splash的网站爬虫
高级语言: Python
项目地址: git://github.com/jasonGeng88/scrapy-splash-demo.git
创建时间: 2017-02-25T13:26:53Z
项目社区:https://github.com/jasonGeng88/scrapy-splash-demo

开源协议:

下载


Scrapy + Splash Demo 示例

本示例基于scrapy和splash技术,实现的爬取去哪儿机票价格最优的一个Demo


            Author:Jason

          E-mail:372922638@qq.com

===========================

技术介绍

  • scrapy: 一个基于Python实现的爬虫框架,提供了各种强大的功能,来帮助完成爬虫工作
  • splash:提供基于js的页面渲染,帮助完成动态网站的加载

运行

运行splash

  1. docker run -p 8050:8050 scrapinghub/splash

安转Python依赖包

  1. pip install -r requirements.txt

配置MySQL(或修改存储方式)

  1. DB_CONNECT = {
  2. 'db': 'test',
  3. 'user': 'root',
  4. 'passwd': '111111',
  5. 'host': '127.0.0.1',
  6. 'charset': 'utf8',
  7. 'use_unicode': True,
  8. }

运行爬虫

  1. scrapy crawl qunar

参考

https://doc.scrapy.org/en/1.3/intro/overview.html
https://github.com/scrapy-plugins/scrapy-splash