with one click
browser-guide
Best practices for using the managed browser — handling login walls, CAPTCHAs, lazy-loaded content, paywalls, and tab cleanup.
Menu
Best practices for using the managed browser — handling login walls, CAPTCHAs, lazy-loaded content, paywalls, and tab cleanup.
| name | browser-guide |
| description | Best practices for using the managed browser — handling login walls, CAPTCHAs, lazy-loaded content, paywalls, and tab cleanup. |
| metadata | {"openclaw":{"emoji":"🌐"}} |
Follow these rules whenever you use the browser tool to interact with web pages.
When a page shows a login wall, first identify which login mechanism is offered, then follow the matching procedure below.
General constraint: retry at most 2 times per login attempt — frequent retries risk account suspension.
When the login page shows a QR code (WeChat Official Account backend, Xiaohongshu creator centre, X/Twitter, etc.):
snapshot to locate the QR code image element. Download / screenshot it and save it to /tmp/ (e.g., /tmp/xhs_qr.png)."[平台名称] 登录已失效(或首次使用),请用 [平台] APP 扫描以下二维码登录。扫码并在手机上点击确认后,回复"已扫码"。"
snapshot for signs of successful login (URL change, QR code disappears, dashboard/avatar appears). If auto-detected, resume immediately without waiting for the user reply.When the login page asks for a phone number and SMS verification code:
"[平台名称] 需要手机验证码登录,请告知您在该平台注册的手机号。"
"短信验证码已发送,请将收到的验证码回复给我。"
When only a username + password form is available:
"[平台名称] 需要账号密码登录,浏览器中未找到预存密码。请选择:① 您自行在浏览器中登录后告知我,② 告知用户名和密码由我代为登录。"
If login cannot be completed for any reason (timeout, user unavailable, repeated failures):
When a page shows a one-click verification challenge (e.g., a button labelled "去验证", "Verify", "I'm not a robot", or a simple checkbox):
If the simple click in Step 2 above fails — the page still shows a challenge, the challenge is a puzzle/slider/image-selection CAPTCHA, or an error occurs:
When a page uses lazy loading (infinite scroll, "load more" sections, content that appears only after scrolling):
evaluate Action — Expression OnlyWhen using the browser tool's evaluate (or act with kind: "evaluate") to run JavaScript in the page context, the fn parameter must be a single expression, not a statement block. Declarations (const, let, var), semicolons, for/if statements, and function declarations will all cause Invalid evaluate function errors.
Wrong (statement block — will fail):
const items = document.querySelectorAll('.msg');
let found = false;
for (const item of items) {
if (item.textContent.includes('target')) { found = true; break; }
}
found ? 'ok' : 'no';
Correct (wrap in IIFE):
(function() {
var items = document.querySelectorAll('.msg');
for (var i = 0; i < items.length; i++) {
if (items[i].textContent.indexOf('target') > -1) { return items[i].innerText; }
}
return 'not found';
})()
Correct (pure expression, for simple lookups):
document.querySelector('.reply-btn') ? 'found' : 'not found'
Rules:
(function(){ ... })()click action on a selector over evaluatesnapshot over evaluate when possibleconst/let/var declarations or ; at the top level of fnWhen a page indicates that content is behind a paywall or requires a specific subscription (e.g., "Subscribe to continue reading", "Continue reading with a WSJ subscription", premium-only banners):
软件著作权登记全流程:从代码仓/目录生成程序鉴别材料(源程序文档)、 软件操作手册、申请填报信息 Markdown,并可辅助在线填报。 当用户需要申请软件著作权、生成软著材料时触发。
维护 business-developer 的 SQLite 追踪数据库,记录已探索的创作者(模式一)和已互动的帖子(模式二),避免重复追踪和重复互动。
通过自媒体平台搜索内容,在评论区以留言/回复/私信等方式拓展潜在客户或进行品牌宣传。用于 HEARTBEAT 定时任务。
维护 business-developer 的 SQLite 情报采集数据库,记录已采集的信息内容,避免重复采集,支持按日查询已采集情报。
定时监控特定信源(自媒体账号/网页),按预设标准提取商业情报,生成简报或报告。用于 cron 定时任务。
通过自媒体平台按搜集策略探索潜在客户——策略 A 分析帖子发布者画像,策略 B 从评论区挖掘潜客。用于 HEARTBEAT 定时任务。