WeChat Article Format Conversion: Exporting Official Account Links to Five Offline Files

Introduction

When organizing data, re-editing, or archiving, WeChat Official Account articles often leave you with just a single mp.weixin.qq.com link. Manually copying the body text results in lost formatting and missing images; simply saving the webpage relies on online resources and WeChat’s display logic. The following introduces the community Skill “WeChat Article Exporter” (@user_733f3aed/wechat-article-exporter, v1.0.0) on SkillHub. It allows you to use natural language or scripts within an Agent to export single or multiple links to Markdown, HTML, Plain Text, JSON, or Excel, while localizing images and styles whenever possible.

What is this

In a nutshell: A Skill for scraping WeChat Official Account article URLs and exporting them to multiple formats. It requires no API Key configuration (requires_api_key=false) and no WeChat login to request article pages.

  • Coordinate: @user_733f3aed/wechat-article-exporter
  • Source: SkillHub Community (community), categorized under data-analysis
  • Publisher: user_733f3aed; The SkillHub skill page lists the author as Luo Jiangyong
  • Official Entries: SkillHub Skill Page, API Coordinate

The Skill includes SKILL.md and Python scripts, intended to be called by clients supporting Skills, such as Cursor, Claude Code, and Codex.

Core Functions

The following capabilities are derived from the official SKILL.md and script descriptions within the package, and have been verified for consistency.

  1. Five Export Formats
    - Markdown (.md): Includes title, author, date, and source link
    - Excel (.xlsx): Table format including metadata and body text (row height approximately 300px)
    - HTML (.html): Standalone webpage with localized CSS and images, can be opened directly in a browser
    - Plain Text (.txt): Format-free body text
    - JSON (.json): Structured data and complete metadata

  2. Scraping Method
    - Directly requests mp.weixin.qq.com using a Chrome-style User-Agent, with the Referer required to include the domain
    - Images prioritize reading data-src (lazy loading) and sync to src; empty img placeholders are cleaned up

  3. HTML Offline Package Structure (Best reading format)
    - Directory example: ArticleTitle_ArticleID/index.html + assets/ (CSS, images)
    - Resource URLs replaced with local relative paths; deduplicated by content hash
    - If total CSS is ≤ 500KB, it is inlined into <style>; otherwise, it uses <link> in assets/
    - Handles visibility:hidden on #js_content to avoid blank pages

  4. Single and Batch Processing
    - Single articles default to saving in ~/Desktop/ArticleTitle_ArticleID/
    - Batch processing defaults to saving in ~/Desktop/WeChatArticlesBatch/

  5. Agent-side Interaction Rules
    - Trigger: User sends https://mp.weixin.qq.com/s/xxx, multiple links, or commands like “Convert this article” or “Save this WeChat article”
    - Must ask for the format before every export (supports serial numbers 1–5 or names, multiple selections allowed, e.g., 1,3,5)

  6. Known Limitations (Stated by official source)
    - Metrics like read counts, likes, and comments require logged-in interfaces and cannot be obtained via pure scraping
    - Deleted or non-compliant articles may fail

Installation and Activation

1. Install SkillHub CLI (If not already installed)

command -v skillhub && skillhub --version

If not installed, you can follow the SkillHub Installation Documentation to perform a complete installation:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

2. Install this Skill

During installation, you must use --dir to point to the current Agent’s skills directory; otherwise, the default location ./skills/ might not be recognized. A client restart is usually required after installation.

Cursor:

skillhub install wechat-article-exporter --namespace user_733f3aed --dir ~/.cursor/skills/

Claude Code:

skillhub install wechat-article-exporter --namespace user_733f3aed --dir ~/.claude/skills/

Codex:

skillhub install wechat-article-exporter --namespace user_733f3aed --dir ~/.codex/skills/

Alternatively, send the following prompt to the AI to let it install via the official process:

Please install `@user_733f3aed/wechat-article-exporter` according to https://skillhub.cn/install/skillhub.md.

3. Script Dependencies

SKILL.md requires the installation of html5lib (pure Python). The core script fetch_article.py also uses beautifulsoup4 to parse pages. It is recommended to run before use:

pip install html5lib beautifulsoup4

When exporting Excel, the script will call table-related libraries (supplement any missing dependencies based on your local Python environment).

Typical Usage

Using in Agent Conversation

  1. Send one or more WeChat article links.
  2. Select the format according to the Skill’s requirements (Example: markdown,html or 1,3).
  3. The Agent calls the script in the installation directory and reports the file name and size upon completion.

Direct Script Call via Command Line

After installation, the script is located at (using Cursor as an example):

~/.cursor/skills/@user_733f3aed/wechat-article-exporter/scripts/

Single Article, Single Format:

python ~/.cursor/skills/@user_733f3aed/wechat-article-exporter/scripts/fetch_article.py \
  "https://mp.weixin.qq.com/s/xxxxxxxx" markdown

format options: markdown | html | text | json | excel. The third parameter can specify output_dir.

Batch, Multiple Formats:

First, write the links into a text file (one URL per line), then execute:

python ~/.cursor/skills/@user_733f3aed/wechat-article-exporter/scripts/batch_fetch.py \
  /path/to/urls.txt markdown,html,json

If formats_csv is omitted, it defaults to markdown.

Scenarios and Notes

Who is it for

  • Editors and developers needing to archive Official Account articles to local knowledge bases (Obsidian, Git, Network Drives)
  • Those needing to excerpt, compare, or perform structured analysis, wanting to export JSON / Excel / Markdown in one go
  • Those needing to preserve layout and images offline should prioritize HTML export

Usage Notes

  • Comply with WeChat platform and copyright regulations; only scrape content you have the right to save
  • Scraping success rate is affected by article status and network; in batch scenarios, rely on the success/failure counts reported by the script
  • The skill is rated 100000 on the SkillHub page (platform display value). As of the data capture time, downloads were approximately 1835 and installs about 34. You may check the latest data on the skill page before selecting.

Conclusion

“WeChat Article Exporter” turns Official Account links into five types of files suitable for long-term storage, emphasizing resource localization in HTML scenarios. If you are already using SkillHub to manage Agent capabilities, you can install it into the corresponding skills directory using the commands above and complete single or batch exports via links or scripts. Skill Page: https://www.skillhub.cn/skills/user_733f3aed/wechat-article-exporter.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye