wechat-mp-article-exporter
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "wechat-mp-article-exporter" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-d4f03a9e778cf17f78eee5093de7257eadf9bcd68e3d1161ce81f5973475d34e. Verify the upstream source and version against https://skillhub.cn/skills/user_3befe356/wechat-mp-article-exporter before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Batch exports WeChat public account articles' titles, publish times, and links. Supports two scenarios: run JS on your account's publish-record page to export all published articles from your account, or search a target account via your account's "hyperlink" and use Python to call the appmsgpublish API to pull another account's history. Provides JS and Python zero-dependency solutions that auto-paginate and export to CSV/JSON. Intended for bulk extraction or download of article lists, titles, links, and publish records from public accounts.
Introduction source: third_party · user_3befe356 · 2.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Software, accounts and paid services
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: wechat-mp-article-exporter
description: >
批量导出微信公众号文章的标题、发布时间和链接。支持两种场景:
(1) 导出自己公众号后台已发表的全部文章,在发表记录页面运行 JS 脚本;
(2) 导出任意其他公众号的全部历史文章,通过自己公众号后台的"超链接"
搜索目标公众号,并用 Python 调用 appmsgpublish 接口拉取。
提供 JS 与 Python 两种零依赖方案,自动翻页抓取并导出 CSV/JSON。
触发场景:用户需要从公众号后台批量提取/导出/抓取/下载文章列表、文章标题、
文章链接、发表记录、发布历史,或提取某个指定公众号的全部文章时使用。
典型触发词:导出公众号文章、提取公众号文章列表、批量获取公众号文章、
公众号后台文章导出、公众号发表记录导出、抓取其他公众号文章、提取指定公众号链接。微信公众号文章批量导出(支持任意公众号)
本技能提供两条相互独立的工作流:
- 方案 A — 导出自己公众号:适合公众号管理员,在「发表记录」页面运行 JS 脚本。
- 方案 B — 导出其他公众号:适合"知道某个公众号名称,想拿走它全部文章链接"的场景, 借助自己公众号后台的「超链接」搜索能力 + Python 调用接口实现。
方案 A:导出自己公众号(管理后台 JS 方案)
适用:你是公众号管理员,已登录 mp.weixin.qq.com 后台。
- 读取
scripts/extract_articles.js,根据用户实际情况调整 CONFIG 参数:maxPages: 总页数(让用户在后台发表记录页面查看分页控件告知)pageSize: 每页条数(默认10)iframeWait: iframe 等待渲染时间(默认4000ms,网络慢可增大)
- 将调整后的脚本提供给用户,指导其在「发表记录」页面 F12 控制台运行
- 脚本自动用隐藏 iframe 逐页加载,提取发布时间/标题/链接,导出 CSV
主脚本: scripts/extract_articles.js
运行方式: 复制脚本内容 -> 公众号后台发表记录页面 -> F12 -> Console -> 粘贴 -> 回车
脚本原理:
- 公众号后台是 Vue 前端渲染,fetch 直接请求 URL 返回的 HTML 不含文章数据
- 点击"下一页"会整页导航,导致脚本上下文丢失
- 解决方案: 用隐藏 iframe 逐页加载不同
begin参数的 URL,iframe 内 JS 渲染完成后从 DOM 提取数据,主页面不跳转
关键选择器:
- 文章链接:
a.weui-desktop-mass-appmsg__title - 标题: 链接内
<span>文本(排除<b>原创</b>标签) - 分页 URL:
appmsgpublish?sub=list&begin={offset}&count=10&token={token}&lang=zh_CN
发布时间提取、常见问题处理、备用方案详见 references/troubleshooting.md。
方案 B:导出其他公众号(超链接接口 + Python 方案)
适用:已知某个公众号名称,想批量提取它发布过的全部文章的标题、链接、发布时间。
原理
微信公众号的文章数据不对外开放搜索,但有一个"后门":你自己公众号后台的「超链接」功能可以搜索任意公众号,并查看其全部历史文章。脚本用你自己后台的登录态(cookie)去请求 appmsgpublish 接口,但查询的是目标公众号的 fakeid,从而实现"以己之名、取他号之文"。
前置条件
- 你有一个自己的微信公众号(个人订阅号即可,mp.weixin.qq.com 免费注册)
- 已安装 Python 3.6+(无需安装任何第三方库,脚本仅用标准库)
- 从浏览器复制三项参数(见下)
获取 cookie / token / fakeid
- 登录 mp.weixin.qq.com 后台
- 点击「新的创作」->「图文信息」-> 顶部工具栏点「超链接」
- 在弹窗搜索框输入目标公众号名称
- 按 F12 打开开发者工具 -> Network 标签 -> 过滤 Fetch/XHR
- 点击文章列表「下一页」翻页,找到
appmsgpublish开头的请求 - 从该请求复制三项:
- cookie:Request Headers 中的完整
cookie值 - token:Query Parameters 中的
token值(纯数字) - fakeid:Query Parameters 中的
fakeid值(一串 Base64 编码字符串,形如xxxx==,即目标公众号 ID)
- cookie:Request Headers 中的完整
运行
- 打开
scripts/export_other_account.py,把上面三项填入脚本顶部对应变量 (若只想填公众号名称,可只填SEARCH_KEYWORD,脚本会自动搜索 fakeid) - 运行:
python scripts/export_other_account.py - 输入一个文件名前缀,脚本自动翻页抓取,直到无更多数据
- 输出
xxx_articles.csv(标题/链接/发布时间)和xxx_articles.json
核心脚本
主脚本: scripts/export_other_account.py
运行方式: 填好 cookie/token/fakeid -> python scripts/export_other_account.py
脚本要点:
- 调用
cgi-bin/appmsgpublish接口,参数为sub=list&fakeid=<目标>&begin=<偏移>&count=5 - 返回为嵌套 JSON:
publish_page(字符串) ->publish_list->publish_info(字符串) ->appmsgex数组(每篇含title/link/create_time)。一次群发可能含多篇文章,脚本会全部展开。 begin每轮 +5 翻页,连续两次返回空即判定到底;每次请求间隔 2~4 秒随机延时防风控。
常见问题(方案 B)
- cookie 过期:约 2~4 小时失效,脚本返回空或报错时重新 F12 复制一次 cookie/token 即可。
fingerprint报错:脚本里FINGERPRINT来自你复制的请求,跨会话可能失效;若报错可删除该行再试。- 抓到 0 篇:检查 fakeid 是否正确、cookie/token 是否还有效。
- 网络限制:脚本需能访问 mp.weixin.qq.com;公司网络/代理异常时可能被拦截。
- 想抓多个公众号:每次复制对应公众号的 fakeid 替换后重跑,或改用
SEARCH_KEYWORD名称搜索。
技能发布
发布本技能到 SkillHub 或分享给其他用户时,使用 scripts/publish.py 一键完成验证、安全审计、打包。
CLI 发布
python scripts/publish.py --skill . --out ../dist
四步流水线:验证 -> 安全审计 -> 打包 -> 输出发布指引。
打包生成的 .zip 文件用于上传 SkillHub(只接受 .zip 扩展名),.skill 文件用于本地分享。
Agent 对话式发布
用户说"发布 wechat-mp-article-exporter"时,Agent 自动:读取 SKILL.md 验证结构、扫描代码做安全审计、调用 scripts/publish.py 打包(SKILL.md 在压缩包根目录)、输出 SkillHub 发布步骤。
详细发布流程
详见 references/publishing-guide.md,包含 CLI 参数说明、安全审计规则、SkillHub 上传步骤、常见问题处理。
Current listing version
2.0.0
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供两种独立工作流,覆盖导出自己公众号和其他公众号的场景
- 解决用户从公众号后台批量提取文章列表的实际需求
- 具有广泛受众的实用能力
Highlights
- 触发场景描述详细,覆盖多种变体
- 典型触发词列举全面,边界清晰
Highlights
- 文档结构清晰,分为方案 A 和方案 B
- 每个方案都有详细的步骤说明和运行方式
- 包含端到端示例,frontmatter 完整
Highlights
- 提供 JS 和 Python 两种零依赖方案
- 工具来源明确,参数说明详细
- 覆盖了主要异常情况并提供处理建议
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Translation pending; see source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.