Weixin Article Reader
Quick Start
Use the bundled script first:
python3 scripts/read_weixin_article.py 'https://mp.weixin.qq.com/s/...' --format md
For machine-readable output:
python3 scripts/read_weixin_article.py 'https://mp.weixin.qq.com/s/...' --format json
To save output:
python3 scripts/read_weixin_article.py 'https://mp.weixin.qq.com/s/...' --format md --output article.md
Workflow
- Run
scripts/read_weixin_article.pyon themp.weixin.qq.comURL. - Treat success as
ok: trueandhas_js_content: true, not merely HTTP 200. - If the first fetch lacks
id="js_content", let the script retry with a WeChat/MicroMessenger mobile User-Agent. - If output still has
ok: false, report that the current environment received a verification/shell page. Then try user-approved alternatives: browser session extraction, screenshots/OCR, or searching the title for mirrors/cached references. - When summarizing, cite that the article was read from the provided public URL and mention if a WeChat UA retry was needed.
Important Checks
- HTTP 200 is not enough. WeChat often returns a
200 text/htmlverification or inline-script shell page. - Require
id="js_content"before claiming the article body was fetched. - Read publish time from visible
#publish_timewhen present; otherwise use JS variables such ascreateTime,ct, ororiCreateTime. - Do not use cookies or the user's WeChat login state unless the user explicitly asks for browser-session extraction.
- Do not bypass access controls. This skill is for public pages that the server returns as article HTML.
Script Output
JSON output includes:
ok: whether article正文 was extractedattempt:desktoporwechat_uaurlandfinal_urlhttp_statusandcontent_typehas_js_contenttitle,author,publish_time,create_time,ct,ct_beijingparagraphs,text,imagesdiagnostics: short reason when extraction fails
Markdown output includes title metadata, the source URL, and extracted正文.