微信公众号文章抓取与阅读助手
通过 Playwright 无头浏览器抓取微信公众号文章全文,支持后续阅读、总结、翻译等操作。
触发条件
用户消息中包含 mp.weixin.qq.com 链接,且意图为阅读/总结/讨论文章内容。
工作流程
第 1 步:环境检查与依赖安装
在执行抓取前,确保 Playwright 可用:
# 检查 node_modules 中是否有 playwright
ls node_modules/playwright 2>/dev/null || npm install playwright
注意:Playwright 需要 Chromium 浏览器内核。首次使用时可能需要运行
npx playwright install chromium。
第 2 步:执行抓取
调用抓取脚本,脚本位于本 skill 目录下:
node <skill-dir>/scripts/fetch.mjs "<微信文章URL>"
脚本输出格式:
---META---
[Description truncada. Veja o README completo no GitHub.]