Best practices for using the managed browser — handling login walls, CAPTCHAs, lazy-loaded content, paywalls, and tab cleanup.
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).Read tool so it is displayed inline to the user:
Read: /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):
When 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):