ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

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.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/benzking/wechat-to-markdown-converter
Or

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

  1. Ensure Python dependencies are available. Install if missing:

    pip install requests beautifulsoup4 markdownify
    
  2. 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
  3. 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 .md file and present a summary.
  • For batch conversions, report success/failure count.

Core Capabilities

1.

Metadata

Author@benzking
Stars4473
Views0
Updated2026-05-01
View Author Profile
AI Skill Finder

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 skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-benzking-wechat-to-markdown-converter": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.