← 返回
未分类 中文

WeChat Browser Reader

Read WeChat Official Account articles (mp.weixin.qq.com) via Chrome DevTools browser automation. Use when user provides a WeChat article URL and other extrac...
通过 Chrome DevTools 浏览器自动化读取微信公众平台文章 (mp.weixin.qq.com)。当用户提供微信文章链接及其他信息时使用。
zmlgit zmlgit 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 415
下载
💾 0
安装
1
版本
#latest

概述

WeChat Browser Reader

Read WeChat articles via Chrome DevTools when HTTP-based extractors fail.

Prerequisites

  • Chrome with remote debugging enabled: google-chrome --no-first-run --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug-profile
  • OpenClaw browser tools available (navigate_page, evaluate_script, etc.)

Workflow

1. Navigate

navigate_page(url=<article_url>)

2. Handle Captcha (if present)

If the page shows "环境异常" / "去验证":

take_snapshot()  # find the "去验证" element
click(uid=<verify_button_uid>)

If the page shows "轻触查看原文" (non-WeChat container):

evaluate_script(() => document.querySelector('.wx_expand_article_button_wrap')?.click())

3. Wait for Content

WeChat articles use JS encryption. Content may take 3-5 seconds to decrypt after page load.

wait_for(text=["activity-name", "js_content"], timeout=15000)

4. Extract Content

evaluate_script(() => {
  const title = document.getElementById('activity-name')?.innerText || '';
  const author = document.getElementById('js_name')?.innerText || '';
  const content = document.getElementById('js_content')?.innerText || '';
  return { title, author, contentLength: content.length, content };
})

If activity-name is empty but js_content exists, content is loaded — just extract it.

If both are empty after 10+ seconds, try:

evaluate_script(() => new Promise(resolve => {
  setTimeout(() => {
    const el = document.getElementById('js_content');
    resolve({ exists: !!el, htmlLen: el?.innerHTML?.length || 0, text: el?.innerText || '' });
  }, 5000);
}))

5. Return to User

Summarize or present the article content. Key fields:

  • title: article title
  • author: account name
  • content: full article text

Common Issues

SymptomCauseFix
---------------------
"环境异常"Captcha triggeredClick "去验证", wait for redirect
"轻触查看原文"Non-WeChat browserClick the button or use JS click
Empty content after loadJS decryption not completeWait 3-5 seconds, retry extraction
Chrome not connectedRemote debugging not runningStart Chrome with --remote-debugging-port=9222
Page stuck on loadingNetwork or rendering issueReload page, check network conditions

Tips

  • Always use evaluate_script with setTimeout (3-5s) for reliable content extraction — WeChat's JS decryption is async
  • If captcha keeps appearing, the IP may be rate-limited — wait a few minutes
  • The approach works because a real Chrome browser executes WeChat's decryption scripts, unlike HTTP-only fetchers

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-03 08:30 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

AdMapix

fly0pants
AdMapix 原始数据层,提供广告创意、应用、排名、下载/收入及市场元数据。返回 AdMapix API 的结构化 JSON;调用方...
★ 297 📥 141,559
ai-agent

Task Watchdog

zmlgit
监控子代理故障、执行错误和过期任务,在异常事件时自动通知会话,并定期检查任务健康状态。
★ 0 📥 315
data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 211 📥 69,554