wechat-article-spider

Convert WeChat public-account articles into Markdown files with locally downloaded images.

2.5k|134|Updated Jun 6, 2025
One-click install
npx skills add https://github.com/UnicomAI/wanwu --skill wechat-article-spider
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wechat-article-spider
Source: https://github.com/UnicomAI/wanwu/tree/main/configs/microservice/bff-service/configs/agent-skills/clawhub/wechat-article-spider
Command: npx skills add https://github.com/UnicomAI/wanwu --skill wechat-article-spider

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, beautifulsoup4, lxml, and includes scripts (resource) components.

What problem does it solve?

WeChat public-account articles are hard to archive or reuse offline, and manually saving content and images is tedious. This Skill fetches an article URL and produces a clean Markdown file with all images downloaded locally.

Core Features & Use Cases

  • Article Scraping: Fetches the article HTML and extracts the title, author, publish date, and body content.
  • Image Downloading: Downloads all article images into an images/ folder and rewrites references as relative paths.
  • Markdown Conversion: Converts the article HTML into Markdown with a metadata header including source URL and fetch time.
  • Use Case: A content maintainer archives a WeChat article by running the script with the article URL, receiving a Markdown file plus a local images folder ready for documentation or offline review.

Quick Start

Ask the assistant to run the wechat-article-spider script with a WeChat article URL, optionally specifying an output directory for the Markdown and images.

Frequently Asked Questions about wechat-article-spider

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert a WeChat article to Markdown?

Run the main.py script with the article URL as an argument, optionally followed by an output directory. The script fetches the article, downloads its images, and writes a Markdown file with relative image paths.

How do I download images from a WeChat article?

The script extracts all img tags from the article HTML and downloads each image into an images subdirectory using requests. Image filenames include a URL hash to avoid duplicates, and Markdown references use relative paths.

What Python dependencies are needed to scrape WeChat articles?

The script requires requests for HTTP fetching, beautifulsoup4 for HTML parsing, and lxml as the parser backend. Install them with pip using the provided requirements.txt file.

Why does WeChat article scraping fail or miss images?

WeChat may apply anti-scraping measures that block requests, and dynamically loaded images may not appear in the initial HTML. Retry later when fetching fails and review the generated Markdown for missing content.

Can I specify a custom output directory for the Markdown file?

Yes, pass a second command-line argument after the article URL to set the output directory. Without it, the script writes to a default docs directory relative to the workspace.