wechat-article-to-markdown
This skill converts WeChat Official Account (微信公众号) article pages into high-quality, clean Markdown format. It should be used when the user provides a WeChat article URL (mp.weixin.qq.com) and wants to convert, extract, save, or archive the article content as Markdown. Trigger phrases include "convert WeChat article", "微信文章转Markdown", "save this WeChat article", "extract article content", "抓取微信文章", "文章转MD", or when a mp.weixin.qq.com URL is provided.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/benzking/wechat-article-to-markdown-v2Changelog
v1.1.0 (2026-04-11)
修复:
fetch_with_playwright改用移动端 Chromium(is_mobile=True+ iPhone UA + 393×852 viewport),临时分享链接(tempkey)可正常渲染- 新增懒加载图片处理:滚动触发
data-src图片加载 - 新增「页面不存在」错误检测
对比(v1.0 → v1.1):
| 项目 | 旧版 | 新版 |
|---|---|---|
| User Agent | 桌面 Chrome | iPhone Safari |
| Viewport | 1280×900 | 393×852 |
| 临时链接 | ❌ 无法渲染 | ✅ 正常 |
| 懒加载图片 | ❌ | ✅ 滚动触发 |
WeChat Article to Markdown
Overview
Convert WeChat Official Account articles (mp.weixin.qq.com) into clean, high-quality Markdown. The skill uses a Python script optimized for WeChat's unique DOM structure, featuring deep noise removal, smart code block detection, rich text preservation, and intelligent paragraph formatting.
Workflow
Decision Tree
User provides WeChat article URL?
├── Yes → Go to Step 1: Install Dependencies & Run Script
├── User wants to convert HTML directly?
│ └── Use Step 2: In-Line Conversion (for fetched HTML)
└── User asks about multiple URLs?
└── Use batch mode with -f flag
Step 1: Install Dependencies & Convert
-
Ensure Python dependencies are available. Install if missing:
pip install requests beautifulsoup4 markdownify -
Run the conversion script:
python scripts/wechat_to_md.py "<WECHAT_URL>" -o "<OUTPUT_DIR>"Options:
--no-images— Skip image downloading, keep remote URLs--no-frontmatter— Omit YAML frontmatter- Multiple URLs:
python scripts/wechat_to_md.py url1 url2 url3
-
The output structure:
<OUTPUT_DIR>/ └── <Article_Title>/ ├── <Article_Title>.md └── images/ ├── img_000.png └── img_001.jpg
Step 2: In-Line Conversion (for Pre-Fetched HTML)
If the HTML has already been fetched (e.g., via web_fetch), use the script's convert_simple() function programmatically:
import sys
sys.path.insert(0, "<SKILL_DIR>/scripts")
from wechat_to_md import convert_simple
# 基础用法:仅转换,不下载图片
result = convert_simple("https://mp.weixin.qq.com/s/xxxxx")
markdown = result["markdown"] # Full Markdown string
metadata = result["metadata"] # {title, author, date, url, ...}
code_blocks = result["code_blocks"] # [{lang, code}, ...]
image_urls = result["image_urls"] # 原始图片 URL 列表
# 高级用法:同时下载图片到本地
result = convert_simple(
"https://mp.weixin.qq.com/s/xxxxx",
download_imgs=True, # 启用图片下载
output_dir="./my_article" # 指定输出目录(可选)
)
markdown = result["markdown"] # 图片链接已替换为本地路径
image_mapping = result["image_mapping"] # URL -> 本地路径映射
output_dir = result["output_dir"] # 实际输出目录
Return the Markdown content directly to the user or write it to a file.
Step 3: Present Results
- Display the generated Markdown file path to the user.
- If the user wants to review the content, read the
.mdfile and present a summary. - Fo...
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-benzking-wechat-article-to-markdown-v2": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
wechat-article-exporter
微信公众号推文长截图导出工具。支持多种链接格式,自动处理懒加载图片、视频占位符、底部工具栏遮挡等问题。触发词:微信文章导出、公众号截图、推文保存、mp.weixin.qq.com。
Rsshub Route Generator
Skill by benzking
wechat-article-export
微信公众号多功能导出工具。將公眾號文章導出為長截圖(PNG)、PDF 或 Markdown,支持任選一種或多種格式。觸發詞:「導出微信文章」、「公眾號截圖」、「文章轉PDF」、「文章轉Markdown」、「微信導出」。
wechat-article-to-markdown
This skill converts WeChat Official Account (微信公众号) article pages into high-quality, clean Markdown format. It should be used when the user provides a WeChat article URL (mp.weixin.qq.com) and wants to convert, extract, save, or archive the article content as Markdown. Trigger phrases include "convert WeChat article", "微信文章转Markdown", "save this WeChat article", "extract article content", "抓取微信文章", "文章转MD", or when a mp.weixin.qq.com URL is provided.
Nintendo Switch Daily Report
Skill by benzking