jackwener/OpenCLI · error · CommandExecutionError
weixin search failed while loading Sogou results
Error message
weixin search failed while loading Sogou results
What it means
This CommandExecutionError wraps any failure that occurs while the headless browser navigates to the Sogou Weixin search URL or extracts results. The original error message (timeout, navigation failure, page.evaluate crash) is preserved as the detail argument. It signals the scraping step itself failed, not that results were empty or blocked.
Source
Thrown at clis/weixin/search.js:119
func: async (page, kwargs) => {
const query = String(kwargs.query ?? '').trim();
if (!query) {
throw new ArgumentError('A search query is required.', 'Pass a non-empty keyword to search Weixin articles via Sogou.');
}
const pageNo = normalizePage(kwargs.page);
const limit = normalizeLimit(kwargs.limit);
const searchUrl = buildSearchUrl(query, pageNo);
let payload;
try {
await page.goto(searchUrl);
await page.wait(2);
payload = await page.evaluate(buildExtractSearchResultsEvaluate());
}
catch (error) {
const detail = error instanceof Error ? error.message : String(error);
throw new CommandExecutionError('weixin search failed while loading Sogou results', detail);
}
if (!payload || typeof payload !== 'object' || !Array.isArray(payload.rows)) {
throw new CommandExecutionError('weixin search returned an unreadable browser payload', 'Sogou Weixin may have changed its result page structure.');
}
if (payload.blocked) {
throw new CommandExecutionError('Sogou Weixin blocked this search request', 'Open weixin.sogou.com in Chrome and complete any verification before retrying.');
}
if (payload.invalidCount > 0) {
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.');
}
const rows = payload.rows;
if (rows.length === 0 && payload.empty) {
throw new EmptyResultError('weixin search', 'Try a different keyword or a different page number.');
}
if (rows.length === 0) {
throw new CommandExecutionError('weixin search did not expose article result cards', 'Sogou Weixin may have changed its selectors or returned a transient shell page.');View on GitHub (pinned to 49907e53dc)
Solutions
- Re-run the command once — transient navigation timeouts are common
- Check network/proxy connectivity to weixin.sogou.com (curl the search URL)
- Increase the navigation/wait timeout in the CLI config if available
- Read the wrapped `detail` message to identify the underlying browser failure
Example fix
// before
await page.goto(searchUrl);
// after (caller retries on failure)
try { const rows = await cli.weixinSearch(query); }
catch (e) { if (isTransient(e)) return retry(() => cli.weixinSearch(query), 2); throw e; } Defensive patterns
Strategy: retry
Validate before calling
await fetch('https://weixin.sogou.com').then(r => { if (!r.ok) throw new Error('sogou unreachable'); }); Try / catch
try { rows = await weixinSearch(q); }
catch (e) {
if (String(e.message).includes('failed while loading')) return retry(weixinSearch, { retries: 2, backoff: 'exponential' });
throw e;
} Prevention
- Add retry with backoff around search calls
- Ensure stable network/proxy to weixin.sogou.com
- Avoid concurrent searches hammering the browser
When it happens
Trigger: page.goto to the Sogou search URL times out or is interrupted; page.wait or page.evaluate throws (e.g. a selector/DOM API changed, browser crashed); network errors reaching weixin.sogou.com during result-page load.
Common situations: Slow or flaky network / proxy causing navigation timeouts; Sogou serving a challenge page that breaks the evaluate script; transient browser automation failures after long sessions.
Related errors
- Ctrip round-trip flight page did not render flight cards (st
- Douyin search extraction failed: ${error instanceof Error ?
- grok ask response
- TimeoutError
- ${label} failed: ${error?.message ?? error}
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/0ef84b0f20f9ac87.
Report an issue: GitHub.