内容
# Kreuzcrawl
<div align="center" style="display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 20px 0;">
<a href="https://github.com/kreuzberg-dev/alef">
<img src="https://img.shields.io/badge/Bindings-alef-007ec6" alt="Bindings">
</a>
<!-- Language Bindings -->
<a href="https://crates.io/crates/kreuzcrawl">
<img src="https://img.shields.io/crates/v/kreuzcrawl?label=Rust&color=007ec6" alt="Rust">
</a>
<a href="https://pypi.org/project/kreuzcrawl/">
<img src="https://img.shields.io/pypi/v/kreuzcrawl?label=Python&color=007ec6" alt="Python">
</a>
<a href="https://www.npmjs.com/package/@kreuzberg/kreuzcrawl">
<img src="https://img.shields.io/npm/v/@kreuzberg/kreuzcrawl?label=Node.js&color=007ec6" alt="Node.js">
</a>
<a href="https://www.npmjs.com/package/@kreuzberg/kreuzcrawl-wasm">
<img src="https://img.shields.io/npm/v/@kreuzberg/kreuzcrawl-wasm?label=WASM&color=007ec6" alt="WASM">
</a>
<a href="https://central.sonatype.com/artifact/dev.kreuzberg.kreuzcrawl/kreuzcrawl">
<img src="https://img.shields.io/maven-central/v/dev.kreuzberg.kreuzcrawl/kreuzcrawl?label=Java&color=007ec6" alt="Java">
</a>
<a href="https://pkg.go.dev/github.com/kreuzberg-dev/kreuzcrawl/packages/go">
<img src="https://img.shields.io/github/v/tag/kreuzberg-dev/kreuzcrawl?label=Go&color=007ec6" alt="Go">
</a>
<a href="https://www.nuget.org/packages/Kreuzcrawl/">
<img src="https://img.shields.io/nuget/v/Kreuzcrawl?label=C#&color=007ec6" alt="C#">
</a>
<a href="https://packagist.org/packages/kreuzberg-dev/kreuzcrawl">
<img src="https://img.shields.io/packagist/v/kreuzberg-dev/kreuzcrawl?label=PHP&color=007ec6" alt="PHP">
</a>
<a href="https://rubygems.org/gems/kreuzcrawl">
<img src="https://img.shields.io/gem/v/kreuzcrawl?label=Ruby&color=007ec6" alt="Ruby">
</a>
<a href="https://hex.pm/packages/kreuzcrawl">
<img src="https://img.shields.io/hexpm/v/kreuzcrawl?label=Elixir&color=007ec6" alt="Elixir">
</a>
<a href="https://pub.dev/packages/kreuzcrawl">
<img src="https://img.shields.io/pub/v/kreuzcrawl?label=Dart&color=007ec6" alt="Dart">
</a>
<a href="https://central.sonatype.com/artifact/dev.kreuzberg.kreuzcrawl.android/kreuzcrawl-android">
<img src="https://img.shields.io/maven-central/v/dev.kreuzberg.kreuzcrawl.android/kreuzcrawl-android?label=Kotlin&color=007ec6" alt="Kotlin">
</a>
<a href="https://github.com/kreuzberg-dev/kreuzcrawl/tree/main/packages/swift">
<img src="https://img.shields.io/badge/Swift-SPM-007ec6" alt="Swift">
</a>
<a href="https://github.com/kreuzberg-dev/kreuzcrawl/tree/main/packages/zig">
<img src="https://img.shields.io/badge/Zig-package-007ec6" alt="Zig">
</a>
<a href="https://github.com/kreuzberg-dev/kreuzcrawl/releases">
<img src="https://img.shields.io/badge/C-FFI-007ec6" alt="C FFI">
</a>
<a href="https://github.com/kreuzberg-dev/kreuzcrawl/pkgs/container/kreuzcrawl">
<img src="https://img.shields.io/badge/Docker-ghcr.io-007ec6?logo=docker&logoColor=white" alt="Docker">
</a>
<!-- Project Info -->
<a href="https://github.com/kreuzberg-dev/kreuzcrawl/blob/main/LICENSE">
<img src="https://img.shields.io/badge/License-Elastic--2.0-007ec6" alt="License">
</a>
<a href="https://docs.kreuzcrawl.kreuzberg.dev">
<img src="https://img.shields.io/badge/Docs-kreuzcrawl-007ec6" alt="Documentation">
</a>
</div>
<div align="center" style="display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 28px 0 24px;">
<a href="https://discord.gg/xt9WY3GnKR">
<img height="22" src="https://img.shields.io/badge/Discord-Chat-007ec6?logo=discord&logoColor=white" alt="加入 Discord">
</a>
</div>
高性能 Rust 网络爬虫引擎,用于结构化数据提取。刮取、爬取和映射网站,支持 14 种语言的原生绑定 - 相同的引擎,在每个运行时都具有相同的结果。
## 什么是 Kreuzcrawl?为什么使用它?
Kreuzcrawl 是爬虫**基础**: 您需要的一切,从头到尾爬取一个站点 - HTML→Markdown,headless-Chrome 备用,robots/sitemap 解析,每个域的限速和 SSRF 安全策略 - 在 14 种语言绑定中具有相同的结果。
产品化问题(托管代理池,调优 WAF 指纹,身份验证会话注入,调度,计费)位于 [kreuzberg-cloud](https://github.com/kreuzberg-dev/kreuzberg-cloud),这是参考操作实现。每个扩展点(`Frontier`,`RateLimiter`,`CrawlStore`,`EventEmitter`,`ContentFilter`,`WafClassifier`,...)都是一个特征,您可以通过 `CrawlEngineBuilder::with_<trait>(...)` 注入。
### 功能
| 功能 | 描述 |
| ------- | ----------- |
| **结构化提取** | 文本、元数据、链接、图像、资产、JSON-LD、Open Graph、hreflang、favicon、标题、响应头 |
| **Markdown 转换** | 干净的 Markdown,带引用、文档结构和适应内容模式 |
| **并发爬取** | 深度优先、广度优先或最佳优先遍历,配置深度、页面限制和并发性 |
| **14 种语言绑定** | Rust、Python、Node.js、Ruby、Go、Java、Kotlin(Android)、C#、PHP、Elixir、Dart、Swift、Zig 和 WebAssembly |
| **智能过滤** | BM25 相关性评分、URL 包含/排除模式、robots.txt 合规性、站点地图发现 |
| **浏览器渲染** | JavaScript-heavy SPA 的可选 headless 浏览器,带有 WAF 检测和绕过 |
| **批处理和流处理** | 同时抓取或爬取数百个 URL;通过异步流实现实时爬取事件 |
| **默认 SSRF 安全** | 拒绝环路、私有、链接本地和云元数据地址;通过 env var 或 `CrawlConfig` 选择退出 |
| **身份验证和速率限制** | HTTP Basic、Bearer 和自定义标头身份验证,带有 cookie jar;每个域的请求限速 |
| **MCP 服务器和 REST API** | 模型上下文协议集成,用于 AI 代理和带有 OpenAPI 规范的 HTTP 服务器 |
### 支持的平台
每个绑定的预编译二进制文件,适用于 Linux(x86_64/aarch64)、macOS(ARM64)和 Windows(x64)。请参阅 [平台支持参考](https://docs.kreuzcrawl.kreuzberg.dev) 以获取完整的矩阵。
<div align="center">
<a href="https://github.com/kreuzberg-dev/kreuzcrawl/stargazers">
<img src="docs/assets/star.gif" alt="在 GitHub 上为 Kreuzcrawl 加星" width="640">
</a>
</div>
<p align="center"><strong>⭐ 为该仓库加星以表达您的支持 - 它有助于其他人发现 Kreuzcrawl。</strong></p>
## 快速入门
### 语言包
<details open>
<summary><strong>Python</strong></summary>
```sh
pip install kreuzcrawl
```
请参阅 [Python README](https://github.com/kreuzberg-dev/kreuzcrawl/tree/main/packages/python) 以获取完整文档。
</details>
<details>
<summary><strong>Node.js</strong></summary>
```sh
npm install @kreuzberg/kreuzcrawl
```
请参阅 [Node.js README](https://github.com/kreuzberg-dev/kreuzcrawl/tree/main/crates/kreuzcrawl-node) 以获取完整文档。
</details>
<details>
<summary><strong>Rust</strong></summary>
```sh
cargo add kreuzcrawl
```
请参阅 [Rust README](https://github.com/kreuzberg-dev/kreuzcrawl/tree/main/crates/kreuzcrawl) 以获取完整文档。
</details>
<details>
<summary><strong>Go</strong></summary>
```sh
go get github.com/kreuzberg-dev/kreuzcrawl/packages/go
```
请参阅 [Go README](https://github.com/kreuzberg-dev/kreuzcrawl/tree/main/packages/go) 以获取完整文档。
</details>
<details>
<summary><strong>Java</strong></summary>
可在 Maven Central 上以 `dev.kreuzberg.kreuzcrawl:kreuzcrawl` 的形式获取。请参阅 [Java README](https://github.com/kreuzberg-dev/kreuzcrawl/tree/main/packages/java) 以获取依赖代码段和当前版本。
</details>
<details>
<summary><strong>C#</strong></summary>
```sh
dotnet add package Kreuzcrawl
```
请参阅 [C# README](https://github.com/kreuzberg-dev/kreuzcrawl/tree/main/packages/csharp) 以获取完整文档。
</details>
<details>
<summary><strong>Ruby</strong></summary>
```sh
gem install kreuzcrawl
```
请参阅 [Ruby README](https://github.com/kreuzberg-dev/kreuzcrawl/tree/main/packages/ruby) 以获取完整文档。
</details>
<details>
<summary><strong>PHP</strong></summary>
```sh
composer require kreuzberg-dev/kreuzcrawl
```
请参阅 [PHP README](https://github.com/kreuzberg-dev/kreuzcrawl/tree/main/packages/php) 以获取完整文档。
</details>
<details>
<summary><strong>Elixir</strong></summary>
在您的 `mix.exs` 依赖项中添加 `{:kreuzcrawl, "~> 0.3"}`。请参阅 [Elixir README](https://github.com/kreuzberg-dev/kreuzcrawl/tree/main/packages/elixir) 以获取完整文档。
</details>
<details>
<summary><strong>Dart / Flutter</strong></summary>
```sh
dart pub add kreuzcrawl
```
请参阅 [Dart README](https://github.com/kreuzberg-dev/kreuzcrawl/tree/main/packages/dart) 以获取完整文档。
</details>
<details>
<summary><strong>Kotlin (Android)</strong></summary>
可在 Maven Central 上以 `dev.kreuzberg.kreuzcrawl.android:kreuzcrawl-android` 的形式获取。请参阅 [Kotlin README](https://github.com/kreuzberg-dev/kreuzcrawl/tree/main/packages/kotlin-android) 以获取依赖代码段和当前版本。
</details>
<details>
<summary><strong>Swift</strong></summary>
通过 Swift Package Manager 添加。请参阅 [Swift README](https://github.com/kreuzberg-dev/kreuzcrawl/tree/main/packages/swift) 以获取完整文档。
</details>
<details>
<summary><strong>Zig</strong></summary>
请参阅 [Zig README](https://github.com/kreuzberg-dev/kreuzcrawl/tree/main/packages/zig) 以获取安装和使用说明。
</details>
<details>
<summary><strong>WebAssembly</strong></summary>
```sh
npm install @kreuzberg/kreuzcrawl-wasm
```
请参阅 [WebAssembly README](https://github.com/kreuzberg-dev/kreuzcrawl/tree/main/crates/kreuzcrawl-wasm) 以获取完整文档。
</details>
<details>
<summary><strong>C/C++ (FFI)</strong></summary>
C 头文件 + 共享库来自 [GitHub Releases](https://github.com/kreuzberg-dev/kreuzcrawl/releases)。请参阅 [FFI crate](https://github.com/kreuzberg-dev/kreuzcrawl/tree/main/crates/kreuzcrawl-ffi) 以获取完整文档。
</details>
<details>
<summary><strong>CLI</strong></summary>
```sh
cargo install kreuzcrawl-cli
```
```sh
brew install kreuzberg-dev/tap/kreuzcrawl
```
请参阅 [CLI README](https://github.com/kreuzberg-dev/kreuzcrawl/tree/main/crates/kreuzcrawl-cli) 以获取完整文档。
</details>
### AI 编码助手
从 [`kreuzberg-dev/plugins`](https://github.com/kreuzberg-dev/plugins) 市场安装 Kreuzcrawl 插件。它包含 Kreuzcrawl 代理技能(站点爬取、HTML→Markdown 抓取、headless-Chrome 备用)以及 `kreuzcrawl` MCP 服务器,并适用于每种主要编码代理 - 在下面扩展您的工具。
<details open>
<summary><strong>Claude Code</strong></summary>
```text
/plugin marketplace add kreuzberg-dev/plugins
/plugin install kreuzcrawl@kreuzberg
```
</details>
<details>
<summary><strong>Codex CLI</strong></summary>
```text
/plugins add https://github.com/kreuzberg-dev/plugins
```
然后搜索 `kreuzcrawl` 并选择 **安装插件**。
</details>
<details>
<summary><strong>Cursor</strong></summary>
设置 → 插件 → 从 URL 添加 → `https://github.com/kreuzberg-dev/plugins`,然后选择 **kreuzcrawl**。
</details>
<details>
<summary><strong>Gemini CLI</strong></summary>
```text
gemini extensions install https://github.com/kreuzberg-dev/plugins
```
</details>
<details>
<summary><strong>Factory Droid</strong></summary>
```text
droid plugin marketplace add https://github.com/kreuzberg-dev/plugins
droid plugin install kreuzcrawl@kreuzberg
```
</details>
<details>
<summary><strong>GitHub Copilot CLI</strong></summary>
```text
copilot plugin marketplace add https://github.com/kreuzberg-dev/plugins
copilot plugin install kreuzcrawl@kreuzberg
```
</details>
<details>
<summary><strong>opencode</strong></summary>
将包添加到 `opencode.json`:
```json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@kreuzberg/opencode-kreuzcrawl"]
}
```
</details>
## 文档
完整的指南、每种语言的 API 参考、底层/操作模型、反bot 策略和可观察性都位于 **[docs.kreuzcrawl.kreuzberg.dev](https://docs.kreuzcrawl.kreuzberg.dev)**。
## 贡献
欢迎贡献!请参阅我们的 [贡献指南](https://github.com/kreuzberg-dev/kreuzcrawl/blob/main/CONTRIBUTING.md)。
## Kreuzberg.dev 的一部分
- [Kreuzberg](https://github.com/kreuzberg-dev/kreuzberg) — 文档智能:文本、表格、元数据,支持 91+ 格式,可选 OCR。
- [Kreuzberg Cloud](https://github.com/kreuzberg-dev/kreuzberg-cloud) — 托管提取 API,带有 SDK、仪表板和可观察性。
- [kreuzcrawl](https://github.com/kreuzberg-dev/kreuzcrawl) — 网络爬取和抓取,带有 HTML→Markdown 和 headless-Chrome 备用。
- [html-to-markdown](https://github.com/kreuzberg-dev/html-to-markdown) — 快速、无损的 HTML→Markdown 引擎。
- [liter-llm](https://github.com/kreuzberg-dev/liter-llm) — 通用 LLM API 客户端,带有 14 种语言的原生绑定和 143 个提供商。
- [tree-sitter-language-pack](https://github.com/kreuzberg-dev/tree-sitter-language-pack) — tree-sitter 语法和代码智能原语。
- [alef](https://github.com/kreuzberg-dev/alef) — 多语言绑定生成器,生成 5 个多语言仓库中的每个语言绑定。
## 许可证
[Elastic License 2.0](https://github.com/kreuzberg-dev/kreuzcrawl/blob/main/LICENSE)
## 链接
- [文档](https://docs.kreuzcrawl.kreuzberg.dev)
- [GitHub 仓库](https://github.com/kreuzberg-dev/kreuzcrawl)
- [问题跟踪器](https://github.com/kreuzberg-dev/kreuzcrawl/issues)
- [变更日志](CHANGELOG.md)
- [Discord](https://discord.gg/xt9WY3GnKR) — 社区、路线图、公告。
连接信息
猜你喜欢
暂无推荐服务器