{"record":{"id":"abd58c187023fb48","repo":"jackwener/OpenCLI","slug":"sogou-weixin-blocked-this-search-request","errorCode":null,"errorMessage":"Sogou Weixin blocked this search request","messagePattern":"Sogou Weixin blocked this search request","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/weixin/search.js","lineNumber":126,"sourceCode":"        const limit = normalizeLimit(kwargs.limit);\n        const searchUrl = buildSearchUrl(query, pageNo);\n\n        let payload;\n        try {\n            await page.goto(searchUrl);\n            await page.wait(2);\n            payload = await page.evaluate(buildExtractSearchResultsEvaluate());\n        }\n        catch (error) {\n            const detail = error instanceof Error ? error.message : String(error);\n            throw new CommandExecutionError('weixin search failed while loading Sogou results', detail);\n        }\n\n        if (!payload || typeof payload !== 'object' || !Array.isArray(payload.rows)) {\n            throw new CommandExecutionError('weixin search returned an unreadable browser payload', 'Sogou Weixin may have changed its result page structure.');\n        }\n        if (payload.blocked) {\n            throw new CommandExecutionError('Sogou Weixin blocked this search request', 'Open weixin.sogou.com in Chrome and complete any verification before retrying.');\n        }\n        if (payload.invalidCount > 0) {\n            throw new CommandExecutionError('Sogou Weixin returned article cards without required title or URL', 'The result page structure may have changed; refusing to return a partial result set.');\n        }\n\n        const rows = payload.rows;\n        if (rows.length === 0 && payload.empty) {\n            throw new EmptyResultError('weixin search', 'Try a different keyword or a different page number.');\n        }\n        if (rows.length === 0) {\n            throw new CommandExecutionError('weixin search did not expose article result cards', 'Sogou Weixin may have changed its selectors or returned a transient shell page.');\n        }\n\n        return rows.slice(0, limit).map((row, index) => ({\n            rank: (pageNo - 1) * 10 + index + 1,\n            page: pageNo,\n            title: row.title,\n            url: row.url,","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/weixin/search.js#L108-L144","documentation":"Thrown when the extraction payload reports `blocked: true`, meaning Sogou Weixin served an anti-bot verification (captcha/slider) page instead of search results. The library refuses to scrape around the challenge and asks the user to verify manually in Chrome. This is an access/rate-limit condition, not a code bug.","triggerScenarios":"Too many rapid searches from the same IP/cookie; the automated browser session triggers Sogou's risk control; a shared/VPN/datacenter IP is flagged; reusing a session cookie that Sogou has invalidated.","commonSituations":"Batch/loop scripts issuing many consecutive searches; running from cloud or VPN IPs that Sogou distrusts; first run from a new network; searching during periods of stricter anti-bot enforcement.","solutions":["Open weixin.sogou.com in a regular Chrome window and complete the verification (captcha/slider), then retry","Wait a few minutes to cool down before retrying","Slow down: add delays between searches and reduce request volume in batch scripts","Switch to a residential/less-flagged IP or disable the VPN","Use fresh browser cookies/profile if the old one is marked suspicious"],"exampleFix":"// before: tight loop\nfor (const q of queries) await search(q);\n// after: throttle and detect blocks\nfor (const q of queries) {\n  const r = await search(q).catch(e => ({ blocked: String(e).includes('blocked') }));\n  if (r.blocked) { await sleep(5 * 60_000); continue; }\n  await sleep(3_000);\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { rows = await weixinSearch(q); }\ncatch (e) {\n  if (String(e.message).includes('blocked')) { await sleep(5 * 60_000); return retryOnce(); }\n  throw e;\n}","preventionTips":["Throttle search rate (seconds between requests)","Complete Sogou verification in Chrome when prompted","Avoid datacenter/VPN IPs for scraping","Reuse a warmed-up browser profile with valid cookies"],"tags":["anti-bot","captcha","rate-limit","scraping"],"backgroundTag":"blocked-by-captcha","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}