jackwener/OpenCLI · error · CommandExecutionError

weixin search did not expose article result cards

Error message

weixin search did not expose article result cards

What it means

Thrown when the payload had a rows array of length 0 but was NOT flagged empty — meaning the page looked non-empty (or the emptiness heuristic failed) yet no article result cards could be extracted. The library suspects changed selectors or a transient shell page rather than a genuine no-results state. It is stricter than 4505 because the page state is inconsistent with a clean empty result.

Source

Thrown at clis/weixin/search.js:137

            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.');
        }

        return rows.slice(0, limit).map((row, index) => ({
            rank: (pageNo - 1) * 10 + index + 1,
            page: pageNo,
            title: row.title,
            url: row.url,
            summary: row.summary,
            publish_time: row.publish_time,
        }));
    },
});

export const __test__ = {
    MAX_LIMIT,
    normalizePage,
    normalizeLimit,
    buildSearchUrl,

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Retry once — transient shell pages resolve on a second load
  2. Upgrade the CLI to get updated selectors
  3. Manually open the search URL in Chrome to check whether article cards render
  4. If manual inspection shows a new layout, report the selector break to maintainers
Defensive patterns

Strategy: retry

Try / catch

try { rows = await weixinSearch(q); }
catch (e) {
  if (String(e.message).includes('did not expose article result cards')) return retryWithBackoff(2);
  throw e;
}

Prevention

When it happens

Trigger: Sogou changed its result-list CSS selectors so extraction matches nothing; the page returned a transient shell/skeleton that never hydrated; a challenge variant the `blocked` heuristic didn't classify; very slow load where cards weren't in DOM at evaluate time.

Common situations: CLI version lagging behind a Sogou frontend update; intermittent infrastructure issues at Sogou serving partial pages; automation browser rendering differences (no JS execution of late hydration).

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/e2524cb921aa2cf7. Report an issue: GitHub.