# Send Webfetch Md to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "webfetch-md",
    "name": "Webfetch Md",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/ShiJianwen/webfetch-md",
    "canonicalUrl": "https://clawhub.ai/ShiJianwen/webfetch-md",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/webfetch-md",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=webfetch-md",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "_meta.json",
      "cli.js",
      "index.js",
      "package-lock.json",
      "package.json"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "webfetch-md",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-10T23:52:22.180Z",
      "expiresAt": "2026-05-17T23:52:22.180Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=webfetch-md",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=webfetch-md",
        "contentDisposition": "attachment; filename=\"webfetch-md-1.1.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "webfetch-md"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/webfetch-md"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/webfetch-md",
    "downloadUrl": "https://openagent3.xyz/downloads/webfetch-md",
    "agentUrl": "https://openagent3.xyz/skills/webfetch-md/agent",
    "manifestUrl": "https://openagent3.xyz/skills/webfetch-md/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/webfetch-md/agent.md"
  }
}
```
## Documentation

### WebFetch MD - 网页转 Markdown

抓取任意网页，转换为干净的 Markdown 格式，保留图片链接。

### 作为 OpenClaw 工具调用

webfetch-md url="https://example.com"

### CLI 使用

# 基本使用（输出 JSON 格式）
npx webfetch-md https://example.com

# 或使用 --url 参数
npx webfetch-md --url https://example.com

# 提取 Markdown 内容（配合 jq）
npx webfetch-md https://example.com | jq -r '.markdown'

# 保存到文件
npx webfetch-md https://example.com | jq -r '.markdown' > article.md

### 输出格式

CLI 和工具都输出统一的 JSON 格式：

{
  "success": true,
  "title": "文章标题",
  "markdown": "# 文章标题\\n\\n正文内容...",
  "images": ["https://example.com/img1.png"],
  "imageCount": 1,
  "contentLength": 1523
}

### 作为模块使用

const { fetchAsMarkdown } = require('./index');
const result = await fetchAsMarkdown('https://example.com');
console.log(result.markdown);

### 功能特点

✅ 抓取任意网页 HTML
✅ 智能提取正文内容（过滤导航、广告等）
✅ 保留图片链接（转换为 ![alt](url) 格式）
✅ 自动转换相对路径为绝对路径
✅ 输出干净的 Markdown

### 依赖

turndown: HTML to Markdown 转换
cheerio: HTML 解析和提取

### 核心流程

网页抓取：使用 fetch API 获取 HTML，模拟浏览器 User-Agent
HTML解析：使用 cheerio 加载和解析 HTML 内容
内容提取：智能识别正文区域，过滤无关元素
URL处理：将相对路径转换为绝对路径
Markdown转换：使用 turndown 转换为标准 Markdown 格式

### 智能内容提取算法

按优先级选择正文容器：

article 标签
main 标签
[role="main"] 属性
.post-content / .entry-content 类
.content / .post 类
#content / #main ID
回退到 body 标签

### 自动过滤的元素

脚本和样式标签
导航、页眉、页脚
侧边栏和广告区域
评论区

### 错误处理

工具返回统一的 JSON 格式，包含 success 字段标识操作状态：

{
  "success": false,
  "error": "错误信息"
}

### 项目结构

webfetch-md/
├── index.js          # 核心功能模块
├── cli.js           # CLI 和 OpenClaw 工具入口
├── package.json     # 依赖配置
├── test.js          # 测试脚本
└── SKILL.md         # 技能文档

### 测试

# 运行测试
npm test

# 或直接测试
node test.js https://example.com

### 版本历史

v1.1.0 (当前): 统一 CLI 和 OpenClaw 工具入口，优化错误处理
v1.0.1: 基础功能实现，支持网页抓取和 Markdown 转换
v1.0.0: 初始版本发布
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: ShiJianwen
- Version: 1.1.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-10T23:52:22.180Z
- Expires at: 2026-05-17T23:52:22.180Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/webfetch-md)
- [Send to Agent page](https://openagent3.xyz/skills/webfetch-md/agent)
- [JSON manifest](https://openagent3.xyz/skills/webfetch-md/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/webfetch-md/agent.md)
- [Download page](https://openagent3.xyz/downloads/webfetch-md)