Agent Skillsdongsheng123132/u-claw › web-to-markdown

web-to-markdown

GitHub

将网页链接转换为干净的 Markdown 格式,支持提取正文、去除干扰元素并保存为文件,便于阅读和二次创作。

portable/skills-cn/web-to-markdown/SKILL.md dongsheng123132/u-claw

Trigger Scenarios

用户希望将网页内容保存为 Markdown 需要将网页正文提取并结构化

Install

npx skills add dongsheng123132/u-claw --skill web-to-markdown -g -y
More Options

Non-standard path

npx skills add https://github.com/dongsheng123132/u-claw/tree/main/portable/skills-cn/web-to-markdown -g -y

Use without installing

npx skills use dongsheng123132/u-claw@web-to-markdown

指定 Agent (Claude Code)

npx skills add dongsheng123132/u-claw --skill web-to-markdown -a claude-code -g -y

安装 repo 全部 skill

npx skills add dongsheng123132/u-claw --all -g -y

预览 repo 内 skill

npx skills add dongsheng123132/u-claw --list

SKILL.md

Frontmatter
{
    "name": "web-to-markdown",
    "metadata": {
        "openclaw": {
            "emoji": "🔗"
        }
    },
    "description": "网页转 Markdown - 抓取任意网页正文并转成干净的 Markdown,便于阅读\/收藏\/二次创作"
}

网页转 Markdown

把用户给的网页链接抓下来,提取正文,转成干净的 Markdown,方便保存、总结或二次创作。

能力概述

  • 正文提取:去掉导航/广告/页脚,只留主体内容
  • 转 Markdown:标题、列表、链接、代码块保留结构
  • 保存:可写入本地 .md 文件

操作方式

用 Bash 工具。首选 jina.ai 的免费 reader(无需依赖,最省事):

# 最简:jina reader 直接返回干净 Markdown(在链接前加 https://r.jina.ai/)
curl -s "https://r.jina.ai/https://example.com/article" -o article.md
echo "已保存 -> article.md"; head -40 article.md

离线或 jina 不可用时,用 Python 本地转换:

python -c "import markdownify,requests" 2>/dev/null || pip install -q markdownify requests beautifulsoup4
python - <<'PY'
import requests, re
from bs4 import BeautifulSoup
from markdownify import markdownify as md
url = "https://example.com/article"
html = requests.get(url, timeout=15, headers={"User-Agent":"Mozilla/5.0"}).text
soup = BeautifulSoup(html, "html.parser")
for t in soup(["script","style","nav","footer","aside"]): t.decompose()
body = soup.find("article") or soup.find("main") or soup.body
out = md(str(body), heading_style="ATX")
out = re.sub(r"\n{3,}", "\n\n", out).strip()
open("article.md","w",encoding="utf-8").write(out)
print("已保存 -> article.md,", len(out), "字")
PY

使用建议

  • 先问用户要不要保存到文件、文件名
  • 微信公众号/知乎等需要登录的页面可能抓取受限,如失败如实告知
  • 抓取后可顺手做"总结要点",结合 china-search / deepseek-helper 技能

Version History

  • 735e4de Current 2026-07-25 11:23

Same Skill Collection

portable/skills-cn/bilibili-helper/SKILL.md
portable/skills-cn/china-search/SKILL.md
portable/skills-cn/china-translate/SKILL.md
portable/skills-cn/china-weather/SKILL.md
portable/skills-cn/deepseek-helper/SKILL.md
portable/skills-cn/douyin-script/SKILL.md
portable/skills-cn/excel-helper/SKILL.md
portable/skills-cn/image-compress/SKILL.md
portable/skills-cn/pdf-toolkit/SKILL.md
portable/skills-cn/ppt-designer/SKILL.md
portable/skills-cn/qrcode-maker/SKILL.md
portable/skills-cn/wechat-article/SKILL.md
portable/skills-cn/weibo-poster/SKILL.md
portable/skills-cn/word-writer/SKILL.md
portable/skills-cn/xiaohongshu-writer/SKILL.md
portable/skills-cn/zhihu-writer/SKILL.md

Metadata

Files
0
Version
50b2654
Hash
c8dc60cc
Indexed
2026-07-25 11:23

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-30 12:35
浙ICP备14020137号-1 $Гость$