{"id":13414789,"url":"https://github.com/crawlab-team/crawlab","last_synced_at":"2025-05-14T22:07:11.315Z","repository":{"id":37444311,"uuid":"169948217","full_name":"crawlab-team/crawlab","owner":"crawlab-team","description":"Distributed web crawler admin platform for spiders management regardless of languages and frameworks. 分布式爬虫管理平台，支持任何语言和框架","archived":false,"fork":false,"pushed_at":"2025-05-04T13:44:37.000Z","size":24703,"stargazers_count":11737,"open_issues_count":126,"forks_count":1833,"subscribers_count":213,"default_branch":"main","last_synced_at":"2025-05-07T21:59:52.202Z","etag":null,"topics":["crawlab","crawler","crawling-tasks","docker","go","platform","scrapy","scrapyd-ui","spider","spiders-management","web-crawler","webcrawler","webspider"],"latest_commit_sha":null,"homepage":"https://www.crawlab.cn","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crawlab-team.png","metadata":{"files":{"readme":"README-zh.md","changelog":"CHANGELOG-zh.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-02-10T06:01:59.000Z","updated_at":"2025-05-07T08:23:19.000Z","dependencies_parsed_at":"2023-02-09T21:00:57.103Z","dependency_job_id":"f03927db-c2ee-4270-9c85-e25316859c0c","html_url":"https://github.com/crawlab-team/crawlab","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crawlab-team%2Fcrawlab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crawlab-team%2Fcrawlab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crawlab-team%2Fcrawlab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crawlab-team%2Fcrawlab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crawlab-team","download_url":"https://codeload.github.com/crawlab-team/crawlab/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235695,"owners_count":22036963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crawlab","crawler","crawling-tasks","docker","go","platform","scrapy","scrapyd-ui","spider","spiders-management","web-crawler","webcrawler","webspider"],"created_at":"2024-07-30T21:00:36.836Z","updated_at":"2025-05-14T22:07:06.296Z","avatar_url":"https://github.com/crawlab-team.png","language":"Go","funding_links":[],"categories":["Misc","Go","开源类库","HarmonyOS","爬虫","Open source library","网络服务","Go (531)","Application Recommendation","Scrapy Distributed","Repositories","🌐 Web Development - Frontend"],"sub_categories":["爬虫","Windows Manager","Crawlers","网络爬虫","🤖 Automation Tools"],"readme":"# Crawlab\n\n\u003cp\u003e\n  \u003ca href=\"https://github.com/crawlab-team/crawlab/actions/workflows/docker-crawlab.yml\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://github.com/crawlab-team/crawlab/workflows/Docker%20Image%20CI:%20crawlab/badge.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://hub.docker.com/r/tikazyq/crawlab\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/docker/pulls/tikazyq/crawlab?label=pulls\u0026logo=docker\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/crawlab-team/crawlab/releases\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/release/crawlab-team/crawlab.svg?logo=github\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/crawlab-team/crawlab/commits/main\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/last-commit/crawlab-team/crawlab.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/crawlab-team/crawlab/issues?q=is%3Aissue+is%3Aopen+label%3Abug\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/issues/crawlab-team/crawlab/bug.svg?label=bugs\u0026color=red\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/crawlab-team/crawlab/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/issues/crawlab-team/crawlab/enhancement.svg?label=enhancements\u0026color=cyan\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/crawlab-team/crawlab/blob/main/LICENSE\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/crawlab-team/crawlab.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n中文 | [English](https://github.com/crawlab-team/crawlab)\n\n[安装](#安装) | [运行](#运行) | [截图](#截图) | [架构](#架构) | [集成](#与其他框架的集成) | [比较](#与其他框架比较) | [相关文章](#相关文章) | [社区\u0026赞助](#社区--赞助) | [更新日志](https://github.com/crawlab-team/crawlab/blob/main/CHANGELOG-zh.md) | [免责声明](https://github.com/crawlab-team/crawlab/blob/main/DISCLAIMER-zh.md)\n\n基于Golang的分布式爬虫管理平台，支持Python、NodeJS、Go、Java、PHP等多种编程语言以及多种爬虫框架。\n\n[查看演示 Demo](https://demo.crawlab.cn) | [文档](https://docs.crawlab.cn/zh/)\n\n## 安装\n\n您可以参考这个[安装指南](https://docs.crawlab.cn/zh/guide/installation)。\n\n## 快速开始\n\n请打开命令行并执行下列命令。请保证您已经提前安装了 `docker-compose`。\n\n```bash\ngit clone https://github.com/crawlab-team/examples\ncd examples/docker/basic\ndocker-compose up -d\n```\n\n接下来，您可以看看 `docker-compose.yml` (包含详细配置参数)，以及参考 [文档](http://docs.crawlab.cn) 来查看更多信息。\n\n## 运行\n\n### Docker\n\n请用`docker-compose`来一键启动，甚至不用配置 MongoDB 数据库，**当然我们推荐这样做**。在当前目录中创建`docker-compose.yml`文件，输入以下内容。\n\n```yaml\nversion: '3.3'\nservices:\n  master: \n    image: crawlabteam/crawlab:latest\n    container_name: crawlab_example_master\n    environment:\n      CRAWLAB_NODE_MASTER: \"Y\"\n      CRAWLAB_MONGO_HOST: \"mongo\"\n    volumes:\n      - \"./.crawlab/master:/root/.crawlab\"\n    ports:    \n      - \"8080:8080\"\n    depends_on:\n      - mongo\n\n  worker01: \n    image: crawlabteam/crawlab:latest\n    container_name: crawlab_example_worker01\n    environment:\n      CRAWLAB_NODE_MASTER: \"N\"\n      CRAWLAB_GRPC_ADDRESS: \"master\"\n      CRAWLAB_FS_FILER_URL: \"http://master:8080/api/filer\"\n    volumes:\n      - \"./.crawlab/worker01:/root/.crawlab\"\n    depends_on:\n      - master\n\n  worker02: \n    image: crawlabteam/crawlab:latest\n    container_name: crawlab_example_worker02\n    environment:\n      CRAWLAB_NODE_MASTER: \"N\"\n      CRAWLAB_GRPC_ADDRESS: \"master\"\n      CRAWLAB_FS_FILER_URL: \"http://master:8080/api/filer\"\n    volumes:\n      - \"./.crawlab/worker02:/root/.crawlab\"\n    depends_on:\n      - master\n\n  mongo:\n    image: mongo:4.2\n    container_name: crawlab_example_mongo\n    restart: always\n```\n\n然后执行以下命令，Crawlab主节点、工作节点＋MongoDB 就启动了。打开`http://localhost:8080`就能看到界面。\n\n```bash\ndocker-compose up -d\n```\n\nDocker部署的详情，请见[相关文档](https://docs.crawlab.cn/zh/guide/installation/docker.html)。\n\n## 截图\n\n#### 登陆页\n\n![]( https://github.com/crawlab-team/images/blob/main/20210729/screenshot-login.png?raw=true)\n\n#### 主页\n\n![]( https://github.com/crawlab-team/images/blob/main/20210729/screenshot-home.png?raw=true)\n\n#### 节点列表\n\n![]( https://github.com/crawlab-team/images/blob/main/20210729/screenshot-node-list.png?raw=true)\n\n#### 爬虫列表\n\n![](https://github.com/crawlab-team/images/blob/main/20210729/screenshot-spider-list.png?raw=true)\n\n#### 爬虫概览\n\n![](https://github.com/crawlab-team/images/blob/main/20210729/screenshot-spider-detail-overview.png?raw=true)\n\n#### 爬虫文件\n\n![](https://github.com/crawlab-team/images/blob/main/20210729/screenshot-spider-detail-files.png?raw=true)\n\n#### 任务日志\n\n![](https://github.com/crawlab-team/images/blob/main/20210729/screenshot-task-detail-logs.png?raw=true)\n\n#### 任务结果\n\n![](https://github.com/crawlab-team/images/blob/main/20210729/screenshot-task-detail-data.png?raw=true)\n\n#### 定时任务\n\n![](https://github.com/crawlab-team/images/blob/main/20210729/screenshot-schedule-detail-overview.png?raw=true)\n\n## 架构\n\nCrawlab的架构包括了一个主节点（Master Node）和多个工作节点（Worker Node），以及 [SeaweedFS](https://github.com/chrislusf/seaweedfs) (分布式文件系统) 和 MongoDB 数据库。\n\n![](https://github.com/crawlab-team/images/blob/main/20210729/crawlab-architecture-v0.6.png?raw=true)\n\n前端应用与主节点 (Master Node) 进行交互，主节点与其他模块（例如 MongoDB、SeaweedFS、工作节点）进行通信。主节点和工作节点 (Worker Nodes) 通过 [gRPC](https://grpc.io) (一种 RPC 框架) 进行通信。任务通过主节点上的任务调度器 (Task Scheduler) 进行调度分发，并被工作节点上的任务处理模块 (Task Handler) 接收，然后分配到任务执行器 (Task Runners) 中。任务执行器实际上是执行爬虫程序的进程，它可以通过 gRPC (内置于 SDK) 发送数据到其他数据源中，例如 MongoDB。\n\n### 主节点\n\n主节点是整个Crawlab架构的核心，属于Crawlab的中控系统。\n\n主节点主要负责以下功能:\n1. 爬虫任务调度\n2. 工作节点管理和通信\n3. 爬虫部署\n4. 前端以及API服务\n5. 执行任务（可以将主节点当成工作节点）\n\n主节点负责与前端应用进行通信，并将爬虫任务派发给工作节点。同时，主节点会同步（部署）爬虫到分布式文件系统 SeaweedFS，用于工作节点的文件同步。\n\n### 工作节点\n\n工作节点的主要功能是执行爬虫任务和储存抓取数据与日志，并且通过Redis的`PubSub`跟主节点通信。通过增加工作节点数量，Crawlab可以做到横向扩展，不同的爬虫任务可以分配到不同的节点上执行。\n\n### MongoDB\n\nMongoDB是Crawlab的运行数据库，储存有节点、爬虫、任务、定时任务等数据。任务队列也储存在 MongoDB 里。\n\n### SeaweedFS\n\nSeaweedFS 是开源分布式文件系统，由 [Chris Lu](https://github.com/chrislusf) 开发和维护。它能在分布式系统中有效稳定的储存和共享文件。在 Crawlab 中，SeaweedFS 主要用作文件同步和日志存储。\n\n### 前端\n\nFrontend app is built upon [Element-Plus](https://github.com/element-plus/element-plus), a popular [Vue 3](https://github.com/vuejs/vue-next)-based UI framework. It interacts with API hosted on the Master Node, and indirectly controls Worker Nodes. \n\n前端应用是基于 [Element-Plus](https://github.com/element-plus/element-plus) 构建的，它是基于 [Vue 3](https://github.com/vuejs/vue-next) 的 UI 框架。前端应用与主节点上的 API 进行交互，并间接控制工作节点。\n\n## 与其他框架的集成\n\n[Crawlab SDK](https://github.com/crawlab-team/crawlab-sdk) 提供了一些 `helper` 方法来让您的爬虫更好的集成到 Crawlab 中，例如保存结果数据到 Crawlab 中等等。\n\n### 集成 Scrapy\n\n在 `settings.py` 中找到 `ITEM_PIPELINES`（`dict` 类型的变量），在其中添加如下内容。\n\n```python\nITEM_PIPELINES = {\n    'crawlab.scrapy.pipelines.CrawlabPipeline': 888,\n}\n```\n\n然后，启动 Scrapy 爬虫，运行完成之后，您就应该能看到抓取结果出现在 **任务详情 -\u003e 数据** 里。\n\n### 通用 Python 爬虫\n\n将下列代码加入到您爬虫中的结果保存部分。\n\n```python\n# 引入保存结果方法\nfrom crawlab import save_item\n\n# 这是一个结果，需要为 dict 类型\nresult = {'name': 'crawlab'}\n\n# 调用保存结果方法\nsave_item(result)\n```\n\n然后，启动爬虫，运行完成之后，您就应该能看到抓取结果出现在 **任务详情 -\u003e 数据** 里。\n\n### 其他框架和语言\n\n爬虫任务实际上是通过 shell 命令执行的。任务 ID (Task ID) 作为环境变量 `CRAWLAB_TASK_ID` 被传入爬虫任务进程中，从而抓取的数据可以跟任务管理。\n\n## 与其他框架比较\n\n现在已经有一些爬虫管理框架了，因此为啥还要用Crawlab？\n\n因为很多现有当平台都依赖于Scrapyd，限制了爬虫的编程语言以及框架，爬虫工程师只能用scrapy和python。当然，scrapy是非常优秀的爬虫框架，但是它不能做一切事情。\n\nCrawlab使用起来很方便，也很通用，可以适用于几乎任何主流语言和框架。它还有一个精美的前端界面，让用户可以方便的管理和运行爬虫。\n\n|框架 | 技术 | 优点 | 缺点 | Github 统计数据 |\n|:---|:---|:---|-----| :---- |\n| [Crawlab](https://github.com/crawlab-team/crawlab) | Golang + Vue|不局限于 scrapy，可以运行任何语言和框架的爬虫，精美的 UI 界面，天然支持分布式爬虫，支持节点管理、爬虫管理、任务管理、定时任务、结果导出、数据统计、消息通知、可配置爬虫、在线编辑代码等功能|暂时不支持爬虫版本管理| ![](https://img.shields.io/github/stars/crawlab-team/crawlab) ![](https://img.shields.io/github/forks/crawlab-team/crawlab) |\n| [ScrapydWeb](https://github.com/my8100/scrapydweb) | Python Flask + Vue|精美的 UI 界面，内置了 scrapy 日志解析器，有较多任务运行统计图表，支持节点管理、定时任务、邮件提醒、移动界面，算是 scrapy-based 中功能完善的爬虫管理平台|不支持 scrapy 以外的爬虫，Python Flask 为后端，性能上有一定局限性| ![](https://img.shields.io/github/stars/my8100/scrapydweb) ![](https://img.shields.io/github/forks/my8100/scrapydweb) |\n| [Gerapy](https://github.com/Gerapy/Gerapy) | Python Django + Vue|Gerapy 是崔庆才大神开发的爬虫管理平台，安装部署非常简单，同样基于 scrapyd，有精美的 UI 界面，支持节点管理、代码编辑、可配置规则等功能|同样不支持 scrapy 以外的爬虫，而且据使用者反馈，1.0 版本有很多 bug，期待 2.0 版本会有一定程度的改进| ![](https://img.shields.io/github/stars/Gerapy/Gerapy) ![](https://img.shields.io/github/forks/Gerapy/Gerapy) |\n| [SpiderKeeper](https://github.com/DormyMo/SpiderKeeper) | Python Flask|基于 scrapyd，开源版 Scrapyhub，非常简洁的 UI 界面，支持定时任务|可能有些过于简洁了，不支持分页，不支持节点管理，不支持 scrapy 以外的爬虫| ![](https://img.shields.io/github/stars/DormyMo/SpiderKeeper) ![](https://img.shields.io/github/forks/DormyMo/SpiderKeeper) |\n\n## 贡献者\n\u003ca href=\"https://github.com/tikazyq\"\u003e\n  \u003cimg src=\"https://avatars3.githubusercontent.com/u/3393101?s=460\u0026v=4\" height=\"80\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/wo10378931\"\u003e\n  \u003cimg src=\"https://avatars2.githubusercontent.com/u/8297691?s=460\u0026v=4\" height=\"80\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/yaziming\"\u003e\n  \u003cimg src=\"https://avatars2.githubusercontent.com/u/54052849?s=460\u0026v=4\" height=\"80\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/hantmac\"\u003e\n  \u003cimg src=\"https://avatars2.githubusercontent.com/u/7600925?s=460\u0026v=4\" height=\"80\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/duanbin0414\"\u003e\n  \u003cimg src=\"https://avatars3.githubusercontent.com/u/50389867?s=460\u0026v=4\" height=\"80\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/zkqiang\"\u003e\n  \u003cimg src=\"https://avatars3.githubusercontent.com/u/32983588?s=460\u0026u=83082ddc0a3020279374b94cce70f1aebb220b3d\u0026v=4\" height=\"80\"\u003e\n\u003c/a\u003e\n\n## JetBrains 支持\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.jetbrains.com\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png\" height=\"360\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## 社区\n\n如果您觉得Crawlab对您的日常开发或公司有帮助，请加作者微信 tikazyq1 并注明\"Crawlab\"，作者会将你拉入群。\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://crawlab.oss-cn-hangzhou.aliyuncs.com/gitbook/qrcode.png\" height=\"360\"\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrawlab-team%2Fcrawlab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrawlab-team%2Fcrawlab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrawlab-team%2Fcrawlab/lists"}