{"repo":"xboxeer/NScrapy","free":true,"listed":false,"github":"https://github.com/xboxeer/NScrapy","clone":"git clone https://github.com/xboxeer/NScrapy.git","description":"NScrapy is a .net core corss platform Distributed Spider Framework which provide an easy way to write your own Spider","language":"C#","stars":95,"topics":["spider","dotnet","scrapy","distributed"],"license":"Apache-2.0","category":"deployment-docker-iac","readme_excerpt":"NScrapy 简介 / Introduction NScrapy 是基于 .NET Core 异步编程框架和 Redis 内存存储的开源分布式爬虫框架。NScrapy 的整体思想源于知名的 Python 爬虫框架 Scrapy，整体写法也接近于 Scrapy，支持分布式部署、丰富的中间件扩展以及流式（Fluent）API。 NScrapy is a distributed spider framework based on .NET Core async programming and Redis. Inspired by the famous Python framework Scrapy, NScrapy offers a similar development experience with support for distributed deployment, middleware extensions, and a Fluent API. --- CLI 工具 / CLI Tool 安装 / Installation nscrapy new — 创建爬虫项目 创建新的爬虫项目模板： 参数/选项 说明 --- --- 爬虫名称（PascalCase，必填） -t, --type 模板类型： basic （默认）或 distributed -o, --output 输出目录（默认 . ） --force 覆盖已有文件 示例： nscrapy run — 运行爬虫 运行爬虫程序： 选项 说明 --- --- --role 运行角色： single （默认）、 spider 、 downloader --distributed 启用分布式模式 --redis Redis 连接地址 --redis-password Redis 密码 --redis-ssl 使用 SSL 连接 Redis --receiver-queue 请求队列名称 --response-queue 响应队列名称 --concurrency 并发请求数 --delay 请求间隔（毫秒） -c, --config 配置文件路径 示例： 配置优先级 配置按以下优先级生效（高 → 低）： 1. CLI 参数 — 命令行直接指定 2. 环境变量 — NSCRAPY 前缀（如 NSCRAPY REDIS HOST ） 3. 配置文件 — JSON 配置文件 项目结构 nscrapy new 生成的结构： --- 快速开始 / Quick Start 通过 CLI 创建爬虫（推荐） 通过 NuGet 集成 使用 Fluent API 编写爬虫： 💡 更多 API 用法参见下方「编程指南」章节。 --- Docker 部署 / Docker Deployment 简介 / Overview NScrapy 支持通过 Docker Compose 进行容器化部署，提供三种模式： NScrapy supports containerized deployment via Docker Compose with three modes: 模式 / Mode 适用场景 / Use Case Redis --- --- --- local-only 单节点，无需 Redis / Single-node, no Redis 无 / None (InMemoryScheduler) local-redis 同主机多工作节点 / Multi-worker on same host 本地 Redis 容器","default_branch":null,"files":null,"tree":[],"storefront":"/r/xboxeer","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/xboxeer/NScrapy/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}