Coder Social home page Coder Social logo

fengzhizi715 / netdiscovery Goto Github PK

View Code? Open in Web Editor NEW
639.0 52.0 152.0 116.04 MB

NetDiscovery 是一款基于 Vert.x、RxJava 2 等框架实现的通用爬虫框架/中间件。

License: Apache License 2.0

Java 80.69% Kotlin 16.60% JavaScript 2.14% HTML 0.57%
rxjava2 vertx3 crawler spider selenium htmlunit kotlin coroutines dsl redis lettuce disruptor kafka middleware

netdiscovery's Introduction

NetDiscovery

@Tony沈哲 on weibo License Codacy Badge

功能特点:

  • 轻量级爬虫
  • 模块化设计,便于扩展:支持多种消息队列(Disruptor、Redis、Kafka、RabitMQ、RocketMQ)、多种网络框架(Http Client、Okhttp3、Selenium等),也支持自己实现。
  • 支持分布式
  • 多线程、异步化:底层使用 RxJava 2 的多线程机制
  • 支持线程池隔离:爬虫的 Parser、Pipeline 过程可以放在独立的线程池中进行处理
  • 支持 Request 动态添加到正在运行爬虫的 Queue 中
  • 支持 Kotlin 协程
  • 支持 JS 渲染
  • 支持 Request 自定义 header 信息
  • 支持 debug 功能:在调试时 Request 可以打开 debug 的开关,使用 Local Cache(RxCache) 存储请求的结果,从而避免多次请求同一个网页。
  • 支持失败重试的机制
  • 多纬度控制爬取速度(Pipeline、Request、Download、Domain)等等
  • 支持代理池、User Agent 池、Cookies 池
  • 支持爬虫的深度抓取:能够在 Pipeline 中发起深度抓取
  • 支持 URL 去重:使用布隆过滤器
  • 支持 Spider 的监控、SpiderEngine 的监控 (基于Etcd、Zookeeper)
  • agent 模块能够对当前服务器的 CPU 和内存进行实时监控
  • SpiderEngine 整合 Quartz
  • SpiderEngine 提供 http、RPC 接口

最新版本

模块名 最新版本
netdiscovery-core-core Download
netdiscovery-core-engine Download
netdiscovery-core-engine-monitor Download
netdiscovery-downloader-htmlunit Download
netdiscovery-downloader-httpclient Download
netdiscovery-downloader-okhttp Download
netdiscovery-downloader-selenium Download
netdiscovery-pipeline-couchbase Download
netdiscovery-pipeline-elasticsearch Download
netdiscovery-pipeline-mongo Download
netdiscovery-pipeline-redis Download
netdiscovery-queue-kafka Download
netdiscovery-queue-rabbitmq Download
netdiscovery-queue-redis Download
netdiscovery-queue-rocketmq Download
netdiscovery-kotlin-coroutines Download
netdiscovery-kotlin-dsl Download

NetDiscovery 是基于 Vert.x、RxJava 2 等框架实现的爬虫框架。目前仍在不断地完善中,期望能成为通用的爬虫框架。

对于 Java 工程,如果使用 gradle 构建,由于默认没有使用 jcenter(),需要在相应 module 的 build.gradle 中配置

Gradle

repositories {
    jcenter()
}

Maven

<repositories>
    <repository>
        <id>central</id>
        <name>bintray</name>
        <url>https://jcenter.bintray.com</url>
    </repository>
</repositories>

在 NetDiscovery 中,Spider 可以单独运行,Spider 也可以交给 SpiderEngine 来控制。

SpiderEngine 可以在运行之前注册到 Etcd/Zookeeper,然后由 monitor 对 SpiderEngine 进行监控。

Stargazers over time

Stargazers over time

详细功能查看wiki

案例:

基于本人的开源项目

TODO List:

  • Kotlin 版本增加 Kotlin-Cli
  • 整合 OpenCV 以及 Tesseract,实现 OCR 识别的功能
  • 增加 admin 模块
  • 支持 Consul
  • 增强 HtmlUnit 模块
  • 增加 chromium 的支持
  • 完善 wiki,增加各个模式的使用说明
  • 支持 RxJava 3.x
  • 支持 Java 11
  • 支持 docker

Contributors:

Contributing:

Pull requests are welcome

联系方式:

Wechat:fengzhizi715

Java与Android技术栈:每周更新推送原创技术文章,欢迎扫描下方的公众号二维码并关注,期待与您的共同成长和进步。

License

Copyright (C) 2017 - present, Tony Shen.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

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.