/NetDiscovery

争取实现一个通用的爬虫程序

Primary LanguageJavaApache License 2.0Apache-2.0

NetDiscovery

@Tony沈哲 on weibo License

最新版本

模块 netdiscovery-core netdiscovery-extra
最新版本 Download Download

NetDiscovery目前还是很早期的版本,很多的细节需要不断地完善。

NetDiscovery 功能点:

1.Spider功能

Spider可以单独使用,也可以添加到SpiderEngine中使用。

Spider中内置了很多组件。即使是downloader都支持好几种,可以热插拔随时替换,或者编写自己的downloader。

queue、parser、pipeline也都类似。

在调试的时候,可以使用ConsolePipe或者DebugPipeline

DebugPipeline的效果如下

2.SpiderEngine功能

SpiderEngine可以管理引擎中的爬虫,包括爬虫的生命周期。

2.1 获取某个爬虫的状态

http://localhost:{port}/netdiscovery/spider/{spiderName}

类型:GET

2.2 获取SpiderEngine中所有爬虫的状态

http://localhost:{port}/netdiscovery/spiders/

类型:GET

2.3 修改某个爬虫的状态

http://localhost:{port}/netdiscovery/spider/{spiderName}/status

类型:POST

参数说明:

{
    "status":2   //让爬虫暂停
}
status 作用
2 让爬虫暂停
3 让爬虫从暂停中恢复
4 让爬虫停止

3. admin模块

admin模块可以监控线上的爬虫,并进行管理。前端部分使用elementUI框架进行开发。

NetDiscovery 基本原理:

1.基本原理

2.集群原理

案例:

TODO:

  1. 增加对登录验证码的识别
  2. 增加elasticsearch的支持

联系方式:

QQ交流群:490882934