Loading...
Loading...
Scrape content from WeChat Official Account articles. Use Playwright headless mode to perform background scraping without pop-ups, support dynamically loaded content, automatically extract titles and main text, and save as Markdown files. This skill should be used when users need to scrape WeChat Official Account article content.
npx skill4agent add cat-xierluo/legal-skills wechat-article-fetchlegal-text-formatUser Request → wechat-article-fetch scraping → [Judge Content Type]
↓
┌────────────────────────┴────────────────────────┐
↓ ↓
Legal Content Detected Regular Articles
↓ ↓
Auto-call legal-text-format Save original content to project root directory
↓
Output to archive/ directory# Save to project root directory
node scripts/fetch.js "https://mp.weixin.qq.com/s/xxxxx"
# Save to specified directory
node scripts/fetch.js "https://mp.weixin.qq.com/s/xxxxx" "./articles/"
# Save to specified file
node scripts/fetch.js "https://mp.weixin.qq.com/s/xxxxx" "./articles/case.md"// Scrape article (return results only)
const result = await fetchWechatArticle("https://mp.weixin.qq.com/s/xxxxx");
// Scrape article and auto-save as Markdown file
const result = await fetchWechatArticle(
"https://mp.weixin.qq.com/s/xxxxx",
3, // Retry count (optional)
"./output.md" // Save path (optional)
);
// Return format
{
title: "Article Title",
content: "Article main text...",
url: "Article URL"
}# Basic usage (output to console only)
node scripts/fetch.js "https://mp.weixin.qq.com/s/xxxxx"
# Save to specified file
node scripts/fetch.js "https://mp.weixin.qq.com/s/xxxxx" "./articles/my-article.md"
# Save to directory (automatically use article title as file name)
node scripts/fetch.js "https://mp.weixin.qq.com/s/xxxxx" "./articles/"Title: Article Title
First paragraph of article main text...
Second paragraph of article main text...# Article Title
> Original URL: https://mp.weixin.qq.com/s/xxxxx
> Scraped Time: 2026-01-21 20:30:00
---
First paragraph of article main text...

Second paragraph of article main text...Output Directory/
├── Article_Title.md # Markdown file
└── Article_Title_Assets/ # Image resource folder
├── image_xxx_0.jpg
├── image_xxx_1.jpg
└── ...scripts/fetch.jsconst IMAGE_FILTER_CONFIG = {
minFileSize: 15 * 1024, // Minimum file size (bytes)
enabled: true // Whether to enable filtering
};npx playwright install chromium#js_content.rich_media_contentcmd.execonst urls = [
"https://mp.weixin.qq.com/s/xxxx1",
"https://mp.weixin.qq.com/s/xxxx2",
"https://mp.weixin.qq.com/s/xxxx3"
];
for (const url of urls) {
const result = await fetchWechatArticle(url, 3, "./articles/");
console.log(`Saved: ${result.title}`);
}Please help me scrape this WeChat Official Account article and save it as a Markdown file:
https://mp.weixin.qq.com/s/xxxxx