wechat-article-scraper
Skill1 starsChanged 3 months agoMITView on GitHub
Batch download WeChat (微信公众号) articles as Markdown files with embedded images. Triggers: 下载公众号文章, 批量抓取微信文章, 保存公众号内容, download wechat articles, scrape wechat posts, save articles with images.
- Installs packages
3 other projects use a version of this.
Adopted by
Most recently taken up by
- sam6dvpte34/social-media-skilltheir own version, first seen Nov 8, 2026
- michoney/hermes-skillstheir own version, first seen Oct 17, 2026
- Nitrene123/wechat-article-scrapertheir own version, first seen Aug 27, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- sam6dvpte34/social-media-skill★ 7same name
- michoney/hermes-skills★ 4same name
- Nitrene123/wechat-article-scraper★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
Important: Only short-format URLs (mp.weixin.qq.com/s/xxxxx) work reliably.
- Very specific: line 70
All files have proper dates (not unknown-date)
- Distinctive: line 72
No broken image references
- Very specific: line 86
If any files have unknown-date, the date extraction failed (rare).
- Very specific: line 128
Always check data-src first, fall back to src
- Distinctive: line 156
No embedded videos/GIFs: Only static images are downloaded.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
WeChat Article Scraper
Overview
Batch download WeChat (微信公众号) articles from mp.weixin.qq.com URLs, saving each article as a properly formatted Markdown file with all content images downloaded locally and referenced via correct relative paths (images/artXX_imgXX.png).
When to Use
- User provides one or more
mp.weixin.qq.comURLs and wants the full article content saved - User wants to batch download a series of WeChat articles for offline reading, analysis, or archiving
- User wants to extract text AND images from WeChat articles (WebFetch alone only gets text, no images)
Workflow
Step 1: Prepare URL List
Collect all article URLs from the user. Create a text file with one URL per line:
https://mp.weixin.qq.com/s/xxxxx
https://mp.weixin.qq.com/s/yyyyy
https://mp.weixin.qq.com/s/zzzzzImportant: Only short-format URLs (mp.weixin.qq.com/s/xxxxx) work reliably. Long-format URLs (mp.weixin.qq.com/s?__biz=...&mid=...&sn=...) trigger WeChat's CAPTCHA and will fail. If the user provides long-format URLs, ask them to find the short-format versions instead.
Step 2: Ensure Dependencies
The script requires requests, beautifulsoup4, and lxml. Install into the managed venv:
# Install packages (adjust path to match your environment)
<python-path> -m pip install requests beautifulsoup4 lxmlStep 3: Run the Download Script
Execute the bundled script:
<python-path> <skill-dir>/scripts/download_wechat_articles.py urls.txt \
--output-dir ./articles-md \
--min-image-size 6000Parameters:
urls_file: Text file with one WeChat URL per line (required)--output-dir: Output directory for markdown files (default:./articles-md)--min-image-size: Minimum image size in bytes to keep (default:6000). WeChat articles contain many small decorative icons (3-5KB) that are useless; real content images (charts, tables, screenshots) are typically 10KB+.--start-index: Starting article number for file naming (default:1). Use when downloading additional batches to avoid filename conflicts.--retry: Number of retries on failure (default:3). Uses exponential backoff.
Step 4: Verify Results
After download, check:
- All files have proper dates (not
unknown-date) - Image paths include
images/prefix - No broken image references
Quick check command:
# List articles and their image counts
for f in articles-md/*.md; do
count=$(grep -c '!\[图片\]' "$f")
echo "${count}张 $(basename "$f")"
done
# Check for any unknown-date files
ls articles-md/*unknown-date* 2>/dev/nullIf any files have unknown-date, the date extraction failed (rare). Check the article content for date clues and rename manually.
Output Structure
articles-md/
├── 01-2026-08-03_Article_Title.md
├── 02-2026-08-01_Another_Title.md
├── ...
├── images/
│ ├── art01_img01.png (16KB - content chart)
│ ├── art01_img02.jpg (31KB - screenshot)
│ └── ...
└── manifest.json # metadata for all downloaded articlesThe manifest.json contains:
{
"articles": [
{"idx": 1, "title": "...", "date": "2026-08-03", "filename": "...", "images": 2, "url": "..."}
],
"failed": [
{"idx": 5, "url": "...", "reason": "captcha"}
]
}Key Technical Notes
Date Extraction (Solved)
WeChat renders publish dates via JavaScript, so the <em id="publish_time"> element is empty in raw HTML. The script uses a multi-strategy approach to extract the date:
var ct = "unix_timestamp"— Primary method. WeChat embeds the article's creation time as a Unix timestamp in a JS variable. This is the most reliable source.oriCreateTime = "timestamp"— Fallback.create_time = "YYYY-MM-DD"— Fallback (sometimes present in page scripts).<em id="publish_time">text — Rarely populated in raw HTML, but checked as a fallback.- Title pattern matching — Last resort. Extracts dates from titles like "26.8.1周记" → 2026-08-01.
Image Extraction
- WeChat uses lazy-loading: image URLs are in the
data-srcattribute, notsrc - Always check
data-srcfirst, fall back tosrc - Image extension is determined from both URL pattern and Content-Type header
Content Structure
- Article body is in
<div id="js_content">or<div class="rich_media_content"> - Title is in
<h1 id="activity-name"> - Account name is in
<a id="js_name"> - Content uses nested
<section>,<p>,<span>tags heavily — recursive traversal preserves reading order
Decorative Image Filtering
WeChat articles embed many small UI elements as images:
- Account QR codes (~5KB)
- "Subscribe" buttons (~4KB)
- Decorative dividers (~3KB)
- Emoji/stickers (~2-5KB)
Setting --min-image-size 6000 filters most of these. Real content images (charts, data tables, screenshots) are typically 10KB+.
Rate Limiting
The script includes a 2-second delay between article fetches to avoid being rate-limited by WeChat servers. Do not remove this delay.
Retry Mechanism
Failed downloads automatically retry with exponential backoff (2s, 4s, 8s). The --retry parameter controls the number of attempts.
Limitations
- Long-format URLs blocked: URLs with
__biz=parameter trigger CAPTCHA. Only short URLs (/s/xxxxx) work. - No comments: Article comments are not extracted.
- No embedded videos/GIFs: Only static images are downloaded.
- Temporary URLs: Some WeChat article URLs expire after a period. Download promptly after receiving them.
Resources
scripts/
download_wechat_articles.py— Main batch download script. Accepts a URL list file and output directory, handles image downloading with size filtering, generates properly formatted Markdown with correct image paths. Supports retry logic and multi-strategy date extraction.
requirements.txt
requests— HTTP client for fetching articles and imagesbeautifulsoup4— HTML parsinglxml— Fast XML/HTML parser backend for BeautifulSoup
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

