返回顶部
c

crawl4ai-docker-skillDocker爬虫服务

Dockerized web crawling and scraping service with REST API. Docker化网页爬虫服务 | Web crawler, web scraper, REST API service. Intelligent content extraction with LLM optimization. 智能内容提取 | Docker部署,REST API调用

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
101
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

crawl4ai-docker-skill

Crawl4AI Docker 技能 - 网页爬虫与抓取服务

Docker化网页爬虫服务 | REST API 网页抓取 | LLM 智能提取

基于 Docker 部署的 Crawl4AI 网页爬虫服务,提供完整的 REST API 接口,支持智能内容提取和 LLM 优化输出。

🚀 核心功能

  • - 🐳 Docker 部署 - 容器化服务,端口 11235
  • 🔌 REST API - 完整的 HTTP 接口
  • 🤖 LLM 智能提取 - 支持多种 LLM 提供商
  • 📊 实时监控 - 内置监控面板和 API
  • 高性能 - 异步处理,支持并发请求

📋 快速开始

前提条件

确保 Docker Compose 服务正在运行:

bash

检查服务状态


docker compose ps

健康检查

curl http://localhost:11235/health

访问监控面板

open http://localhost:11235/dashboard

🔌 REST API 使用指南

基础网页抓取

简单 Markdown 提取

bash curl -X POST http://localhost:11235/crawl \ -H Content-Type: application/json \ -d { urls: [https://example.com], extraction_strategy: markdown }

带浏览器配置

bash curl -X POST http://localhost:11235/crawl \ -H Content-Type: application/json \ -d { urls: [https://example.com], extraction_strategy: markdown, browser_config: { headless: true, viewport_width: 1280, viewport_height: 720 } }

LLM 智能提取

内容总结

bash curl -X POST http://localhost:11235/crawl \ -H Content-Type: application/json \ -d { urls: [https://example.com], extraction_strategy: { type: llm, provider: openrouter/free, instruction: 总结网页的主要内容, max_tokens: 1000 } }

结构化数据提取

bash curl -X POST http://localhost:11235/crawl \ -H Content-Type: application/json \ -d { urls: [https://example.com/products], extraction_strategy: { type: llm, provider: openrouter/free, instruction: 提取所有产品名称、价格和描述,返回 JSON 格式, max_tokens: 1500, temperature: 0.1 } }

高级功能

网页截图

bash curl -X POST http://localhost:11235/screenshot \ -H Content-Type: application/json \ -d { url: https://example.com, options: { full_page: true, quality: 80 } }

PDF 生成

bash curl -X POST http://localhost:11235/pdf \ -H Content-Type: application/json \ -d { url: https://example.com }

📊 API 端点参考

核心端点

端点方法用途
POST /crawlPOST网页抓取和内容提取
GET /health
GET | 服务健康检查 | | GET /dashboard | GET | 监控面板 |

监控端点

端点方法用途
GET /monitor/healthGET系统健康状态
GET /monitor/browsers
GET | 浏览器池状态 | | GET /monitor/requests | GET | 请求统计 |

工具端点

端点方法用途
POST /screenshotPOST网页截图
POST /pdf
POST | PDF 生成 | | POST /execute_js | POST | JavaScript 执行 |

🎯 使用场景

场景 1:文档网站爬取

bash
curl -X POST http://localhost:11235/crawl \
-H Content-Type: application/json \
-d {
urls: [https://docs.openclaw.ai/zh-CN],
extraction_strategy: markdown
}

场景 2:新闻文章提取

bash
curl -X POST http://localhost:11235/crawl \
-H Content-Type: application/json \
-d {
urls: [https://news-site.com/article],
extraction_strategy: {
type: llm,
provider: openrouter/free,
instruction: 提取文章标题、作者、发布时间和主要内容,
max_tokens: 1500
}
}

场景 3:产品信息抓取

bash
curl -X POST http://localhost:11235/crawl \
-H Content-Type: application/json \
-d {
urls: [https://ecommerce-site.com/products],
extraction_strategy: {
type: llm,
provider: openrouter/free,
instruction: 提取所有产品的名称、价格、描述和图片链接,
max_tokens: 2000
}
}



⚙️ 配置说明

LLM 提供商配置

创建 .llm.env 文件:

bash

OpenRouter 配置


OPENROUTERAPIKEY=your-api-key
LLM_PROVIDER=openrouter/free
LLMMAXTOKENS=2000
LLM_TEMPERATURE=0.7

或使用其他提供商

OPENAIAPIKEY=sk-your-key

OPENAIBASEURL=https://your-custom-api.com/v1

LLM_PROVIDER=openai/gpt-4o-mini

浏览器配置

json
{
browser_config: {
headless: true,
viewport_width: 1280,
viewport_height: 720,
user_agent: Mozilla/5.0...
}
}



📈 响应格式

成功响应

json
{
success: true,
results: [
{
url: https://example.com,
markdown: # 提取的 Markdown 内容...,
metadata: {
title: 网页标题,
description: 网页描述,
url: https://example.com
},
extracted_content: {
summary: LLM 提取的内容...
}
}
]
}

错误响应

json
{
success: false,
error: 错误信息,
code: ERROR_CODE
}



🔧 故障排除

常见问题

1. 服务未启动

bash

检查容器状态

docker compose ps

查看日志

docker compose logs crawl4ai

重启服务

docker compose restart crawl4ai

2. LLM 提取失败

  • - 检查 .llm.env 配置
  • 验证 API 密钥
  • 测试不同的 LLM 提供商

3. 网络连接问题

bash

测试网络连接

curl -I https://example.com

检查代理配置

env | grep -i proxy

监控和调试

bash

访问监控面板


open http://localhost:11235/dashboard

查看系统健康

curl http://localhost:11235/monitor/health

查看浏览器池状态

curl http://localhost:11235/monitor/browsers

🔗 相关链接


🎉 为什么选择 Docker 版本?

容器化部署 - 一键启动,环境隔离
REST API - 标准 HTTP 接口,易于集成
实时监控 - 内置监控面板和 API
资源管理 - 自动浏览器池管理
生产就绪 - 企业级稳定性和性能

立即

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 crawl4ai-docker-skill-1775970962 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 crawl4ai-docker-skill-1775970962 技能

通过命令行安装

skillhub install crawl4ai-docker-skill-1775970962

下载

⬇ 下载 crawl4ai-docker-skill v1.0.0(免费)

文件大小: 7.85 KB | 发布时间: 2026-4-13 09:53

v1.0.0 最新 2026-4-13 09:53
Initial release of crawl4ai-docker-skill.

- Provides a Dockerized web crawling and scraping service with a full REST API.
- Includes intelligent content extraction using LLM optimization.
- Features real-time monitoring with built-in dashboard and API endpoints.
- Supports advanced operations like webpage screenshots and PDF generation.
- Flexible browser and LLM provider configuration.
- Comprehensive usage examples and troubleshooting included in documentation.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部