Install
openclaw skills install wechat-article-fetcher-safe使用 Puppeteer + Chrome 无头模式抓取微信公众号文章,支持移动端伪装,提取全文及元信息并自动保存文本。
openclaw skills install wechat-article-fetcher-safe使用 Puppeteer + Chrome 本地提取微信公众号文章内容。
| 字段 | 值 |
|---|---|
| 技能名称 | wechat-article-fetcher-safe |
| 版本 | 2.0.0 |
| 作者 | @Adgai115 |
| 创建时间 | 2026-03-21 |
| 更新时间 | 2026-04-22 |
| 适用场景 | 微信公众号文章内容提取 |
| 技术栈 | Node.js + Puppeteer + Chrome |
| 仓库 | https://github.com/Adgai115/wechat-article-fetcher-safe |
node -v # 需要 v18+
cd wechat-article-fetcher-safe
npm install
脚本会自动检测 Chrome 路径。如检测失败,修改脚本中的 chromePath。
Windows 标准路径:
C:\Program Files\Google\Chrome\Application\chrome.exe
node fetch-wechat-article.js https://mp.weixin.qq.com/s/xxx
const { fetchWechatArticle } = require('./fetch-wechat-article');
const result = await fetchWechatArticle({
url: 'https://mp.weixin.qq.com/s/xxx',
saveToFile: true,
outputDir: './output'
});
console.log(result.title);
console.log(result.content);
========== 文章信息 ==========
标题:文章标题
作者:公众号名称
时间:发布日期
========== 文章内容 ==========
(正文内容)
========== 文章结束 ==========
内容已保存到:./article-wechat-xxxxx.txt
const browser = await puppeteer.launch({
executablePath: chromePath,
headless: true,
args: ['--no-sandbox', '--disable-gpu']
});
await page.setUserAgent('Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 ...) MicroMessenger/8.0.0');
await page.setViewport({ width: 375, height: 812 });
const articleData = await page.evaluate(() => {
const title = document.querySelector('#activity-name')?.innerText;
const content = document.querySelector('#js_content')?.innerText;
return { title, content };
});
脚本会自动检测以下路径:
C:\Program Files\Google\Chrome\Application\chrome.exeC:\Program Files (x86)\Google\Chrome\Application\chrome.exe/usr/bin/google-chrome/Applications/Google Chrome.app/Contents/MacOS/Google Chromeawait page.waitForSelector('#js_content', { timeout: 30000 })wechat-article-fetcher-safe/
├── SKILL.md # 技能文档(本文件)
├── fetch-wechat-article.js # 主脚本
├── package.json # npm 配置
├── README.md # 快速入门
└── README.github.md # GitHub 展示文档
MIT-0 (MIT No Attribution)
仓库:https://github.com/Adgai115/wechat-article-fetcher-safe 维护者:@Adgai115 最后更新:2026-04-22