jackwener/OpenCLI · error · CommandExecutionError

weibo user-posts found post candidates but could not extract

Error message

weibo user-posts found post candidates but could not extract valid rows

What it means

If the extractor saw post candidate elements (sawPostCandidates is true) but could not convert any of them into valid rows, the CLI treats it as an extraction/parse failure rather than an empty account, throwing this CommandExecutionError. The DOM had post-like nodes but every candidate failed field validation.

Source

Thrown at clis/weibo/user-posts.js:213

        }

        return [uid, rows, sawList, sawPostCandidates];
      })()
    `);

        const payload = unwrapEvaluateResult(evaluateResult);
        if (payload && !Array.isArray(payload) && typeof payload === 'object' && 'error' in payload) {
            mapError(payload.error);
        }
        if (!Array.isArray(payload) || payload.length !== 4 || !Array.isArray(payload[1])) {
            throw new CommandExecutionError('weibo user-posts returned malformed extraction payload');
        }
        const [resolvedUid, rows, sawList, sawPostCandidates] = payload;
        if (!sawList && rows.length === 0) {
            throw new CommandExecutionError('weibo user-posts did not observe a valid posts list');
        }
        if (sawPostCandidates && rows.length === 0) {
            throw new CommandExecutionError('weibo user-posts found post candidates but could not extract valid rows');
        }
        if (rows.length === 0) {
            throw new EmptyResultError('weibo user-posts', 'No Weibo posts found for this user/date range');
        }

        return rows.slice(0, limit).map((row, index) => ({
            rank: index + 1,
            id: String(row.id),
            mblogid: row.mblogid || '',
            author: row.author || '',
            uid: String(row.uid || resolvedUid || ''),
            text: row.text || '',
            time: row.time || '',
            reposts: row.reposts ?? 0,
            comments: row.comments ?? 0,
            likes: row.likes ?? 0,
            pic_count: row.pic_count ?? 0,
            url: row.url || '',

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Update/upgrade the CLI in case newer selectors handle the new markup.
  2. Retry later — skeleton/placeholder rendering failures are often transient.
  3. Check the failing page in a browser to see if new card types (ads, forwards) appear and adjust extraction for them.
  4. Re-run with a fresh session in case truncated rendering left placeholders in the DOM.
Defensive patterns

Strategy: retry

Try / catch

try {
  const rows = await runUserPosts(opts);
} catch (err) {
  if (err instanceof CommandExecutionError && /could not extract valid rows/.test(err.message)) {
    await sleep(5000);
    return runUserPosts(opts); // skeleton/ad rendering often transient
  }
  throw err;
}

Prevention

When it happens

Trigger: Weibo markup changed so candidates no longer carry the expected id/timestamp/fields; candidates are placeholders, ads, or loading skeletons; or new post types (new card layouts) fail row mapping.

Common situations: Weibo A/B-testing a new feed card layout, promoted/ad posts rendered where organic posts are expected, or partial page renders (skeletons never replaced).

Related errors


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