基于三引擎设计,从微信文章、新闻和博客网页提取干净内容,支持标题作者日期元数据,多格式和批量处理。
Web Content Extractor - 网页内容提取器是一项面向实际任务的技能,主要用于版本 : 2.0;作者 : OpenClaw Team;
🎯 功能概述;基于 Readability + Firecrawl + Defuddle 三引擎的网页内容提取工具,专为中文内容优化;支持微信文章、新闻网站、博客等多种来源,自动去除广告/导航/侧边栏。它将相关步骤、工具调用和结果整理方式集中到统一流程中,帮助使用者更快完成目标并减少重复操作。从功能定位来看,该技能强调把分散的操作要求整理成清晰、可复用的处理流程,使用户能够围绕既定目标快速准备输入、选择执行方式并获得结构化结果。
实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;涉及批量任务时,还应保存进度,避免中断后重复操作。该技能适合用于一次性任务,也可以接入自动化工作流,与其他技能或上层代理配合完成更完整的业务链路;在组合使用时,应明确每一步的输入输出关系,并避免不同步骤之间出现参数冲突。
版本: 2.0
作者: OpenClaw Team
更新日期: 2026-03-15
许可证: MIT
name: web-content-extractor version: 2.0.0 description: 从微信文章/博客/新闻网页提取干净内容,去除广告和侧边栏 category: 内容处理 tags: [网页提取,内容清洗,微信文章,Markdown] author: OpenClaw Team license: MIT
基于 Readability + Firecrawl + Defuddle 三引擎的网页内容提取工具,专为中文内容优化。支持微信文章、新闻网站、博客等多种来源,自动去除广告/导航/侧边栏,输出干净的 Markdown 格式。
核心能力:
# OpenClaw 工具调用
result = web_fetch(
url="https://mp.weixin.qq.com/s/xxx",
extractMode="markdown",
maxChars=8000
)
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| url | str | ✅ | - | 网页 URL |
| extractMode | str | ❌ | "markdown" | 输出格式(markdown/text/json) |
| maxChars | int | ❌ | 8000 | 最大字符数 |
| includeMetadata | bool | ❌ | true | 是否包含元数据 |
| timeout | int | ❌ | 30 | 超时时间(秒) |
{
"url": "https://mp.weixin.qq.com/s/abcdefg",
"extractMode": "markdown",
"maxChars": 8000,
"includeMetadata": true
}
{
"success": true,
"url": "https://mp.weixin.qq.com/s/abcdefg",
"title": "文章标题",
"author": "作者名",
"publishDate": "2026-03-15",
"content": "Markdown 格式的正文内容...",
"wordCount": 2500,
"readTime": "10 分钟",
"images": ["https://..."],
"extractTime": 0.8
}
用户请求
↓
┌────────────────┐
│ 路由判断层 │
└────────────────┘
↓
┌──────────────┼──────────────┐
↓ ↓ ↓
┌─────────┐ ┌─────────┐ ┌─────────┐
│ web_fetch│ │ defuddle│ │ browser │
│ (快速) │ │ (专业) │ │ (兜底) │
└─────────┘ └─────────┘ └─────────┘
↓ ↓ ↓
┌────────────────┐
│ 结果聚合层 │
└────────────────┘
↓
返回用户
| 引擎 | 速度 | 成功率 | 适用场景 |
|---|---|---|---|
| web_fetch | <1s | 70% | 微信文章/通用网页 |
| defuddle | <1s | 75% | 博客/新闻网站 |
| browser | 5-10s | 90% | 复杂 SPA/动态页面 |
result = web_fetch(
url="https://mp.weixin.qq.com/s/xxx",
extractMode="markdown"
)
print(result["content"])
urls = ["url1", "url2", "url3"] results = [web_fetch(url=u) for u in urls]
result = web_fetch(
url="https://example.com/article",
includeMetadata=True
)
print(f"标题:{result['title']}")
print(f"作者:{result['author']}")
print(f"字数:{result['wordCount']}")
| 域名类型 | 请求间隔 | 并发限制 |
|---|---|---|
| 微信文章 | 2 秒 | 1 |
| 新闻网站 | 1 秒 | 3 |
| 博客 | 1 秒 | 5 |
result = web_fetch(
url="https://example.com",
userAgent="Mozilla/5.0 ..."
)
result = web_fetch(
url="https://example.com",
proxy="http://proxy:port"
)
# 启用缓存(1 小时) result = web_fetch(url, cache=True, ttl=3600) # 强制刷新 result = web_fetch(url, cache=False)
| 指标 | 数值 |
|---|---|
| 平均响应时间 | 0.8 秒 |
| P95 响应时间 | 2.5 秒 |
| 成功率 | 85% |
| 缓存命中率 | 60% |
原因:页面需要 JavaScript 渲染
解决:切换到 browser 引擎
原因:链接过期或有反爬
解决:
原因:maxChars 限制
解决:增加 maxChars 参数或分页处理
{
"readability": "^0.4.4",
"firecrawl": "^1.0.0",
"defuddle": "^3.0.0"
}
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)MIT License - 详见 LICENSE
最后更新: 2026-03-15
维护状态: ✅ 活跃维护
相关专题
热门下载
相关下载
精品课程
共39课时 | 5.4万人学习
共101课时 | 20.9万人学习
共39课时 | 4.8万人学习
最新文章