{"record":{"id":"745ac4676c31add2","repo":"jackwener/OpenCLI","slug":"weixin-search-returned-an-unreadable-browser-paylo","errorCode":null,"errorMessage":"weixin search returned an unreadable browser payload","messagePattern":"weixin search returned an unreadable browser payload","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/weixin/search.js","lineNumber":123,"sourceCode":"        }\n\n        const pageNo = normalizePage(kwargs.page);\n        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,","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/weixin/search.js#L105-L141","documentation":"Thrown when the browser-side extraction returns something other than an object with a `rows` array — i.e. the evaluate script produced null, a non-object, or an object missing the expected rows field. The library treats this as a page-structure change it cannot safely interpret, rather than returning garbage. It is a data-integrity guard, not a user-input error.","triggerScenarios":"Sogou's HTML/JS changed so the extraction script returns null or an unexpected shape; the page rendered an error/interstitial whose DOM the script mishandles; the evaluate script itself threw and the payload variable never got the expected shape.","commonSituations":"Sogou ships a frontend redesign or A/B test variant; anti-bot serving a different page template; stale CLI version whose embedded extraction script no longer matches the live page.","solutions":["Upgrade the CLI to the latest version so extraction selectors match the current Sogou page","Open weixin.sogou.com manually and inspect whether the result-page structure changed","Retry later if Sogou is A/B testing — the structure may revert","Report the payload shape change to the CLI maintainers if it persists"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"function isSearchPayload(p) {\n  return p !== null && typeof p === 'object' && Array.isArray(p.rows);\n}","tryCatchPattern":"try { rows = await weixinSearch(q); }\ncatch (e) { if (String(e.message).includes('unreadable browser payload')) return fallbackToNewerCliVersion(); throw e; }","preventionTips":["Keep the CLI updated so extraction scripts track Sogou changes","Pin a fallback version to roll back to when structure changes","Spot-check one query after Sogou deploys updates"],"tags":["scraping","page-structure","anti-bot","data-integrity"],"backgroundTag":"unexpected-response-schema","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}