Git Product home page Git Product logo

snappydata's Introduction

版本更新

v2.0 2019/06/22

  • 服务端改造成springboot

snappy爬虫能做什么

能稳定,准确,快速,集群爬取规则网页的数据,并存储到mysql中。 如

snappy有什么优点

  • 安装方便,编译打包成可执行程序方便
  • 开源,可以一起完成更强大的功能
  • 数据不遗漏,比如安居客二手房,没一秒就有好多数据产生,如果每一页每一条串行爬取,效率低,还可能漏爬。
  • 可用集群分布式多台机器爬取,如果网页数据产生太多,如安居客二手房房源,发现当前爬取慢,只要再找一台服务器启动一个客户端就行了。动态扩展算力。
  • 服务端和客户端都可以自定义爬虫数量
  • 理论支持无上限任务

快速开始

启动server 和 client
  • 克隆本项目到你机器上: git clone https://github.com/peintune/snappydata.git
  • 在项目的根路径执行打包命令:mvn clean package
  • 配置 output/snappyserver 和 里面 config.xml文件里的mysql连接信息为你本机或者云端mysql的信息
  • 打包完成后,启动server, 进入output/snappyserver目录,运行start.bat
  • 启动client 进入output/snappyclient目录,运行start.bat
执行任务
查看采集的数据
  • 查看你的mysql中会生成一张 kuyunzy2 的表,可以看到里面采集好的数据

Alt text

  • 查看client端 Alt text

  • 服务端和client端 Alt text

项目结构

Alt text

如何新添加一个任务,如爬取anjuke

  • 在output/source创建任务文件夹如 anjuke
  • 复制 output/source/demo目录下的kuyunzy2.xml 文件到anjuke目录下,改名为anjuke.xml
  • 修改anjuke.xml里面的内容, 里面只要带‘修改‘ 字样的项都要安装你要爬取的页面相关的修改
  • 在浏览器中输如 http://localhost:8080/message/addSnappier?folder=anjuke&filerex=anjuke 并回车 (添加一个任务)
  • 在浏览器中输入 http://localhost:8080/message/startSnappier?folder=anjuke&filerex=anjuke 并回车 (执行一个任务)
  • 查看server端和client的日志是否报错,如有,根据相关错误调试anjuke.xml中的内容
  • 查看mysql中的数据是否完整,如不完整,检查xml中的column 中的xpath值是否正确

snappydata's People

Contributors

peintune avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.