{"record":{"id":"1a7091e789fa9460","repo":"jackwener/OpenCLI","slug":"weibo-user-posts-did-not-observe-a-valid-posts-lis","errorCode":null,"errorMessage":"weibo user-posts did not observe a valid posts list","messagePattern":"weibo user-posts did not observe a valid posts list","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/weibo/user-posts.js","lineNumber":210,"sourceCode":"          }\n\n          if (list.length < 10) break;\n        }\n\n        return [uid, rows, sawList, sawPostCandidates];\n      })()\n    `);\n\n        const payload = unwrapEvaluateResult(evaluateResult);\n        if (payload && !Array.isArray(payload) && typeof payload === 'object' && 'error' in payload) {\n            mapError(payload.error);\n        }\n        if (!Array.isArray(payload) || payload.length !== 4 || !Array.isArray(payload[1])) {\n            throw new CommandExecutionError('weibo user-posts returned malformed extraction payload');\n        }\n        const [resolvedUid, rows, sawList, sawPostCandidates] = payload;\n        if (!sawList && rows.length === 0) {\n            throw new CommandExecutionError('weibo user-posts did not observe a valid posts list');\n        }\n        if (sawPostCandidates && rows.length === 0) {\n            throw new CommandExecutionError('weibo user-posts found post candidates but could not extract valid rows');\n        }\n        if (rows.length === 0) {\n            throw new EmptyResultError('weibo user-posts', 'No Weibo posts found for this user/date range');\n        }\n\n        return rows.slice(0, limit).map((row, index) => ({\n            rank: index + 1,\n            id: String(row.id),\n            mblogid: row.mblogid || '',\n            author: row.author || '',\n            uid: String(row.uid || resolvedUid || ''),\n            text: row.text || '',\n            time: row.time || '',\n            reposts: row.reposts ?? 0,\n            comments: row.comments ?? 0,","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/weibo/user-posts.js#L192-L228","documentation":"After payload validation, the CLI distinguishes two empty cases. If the extractor reports it never observed a valid posts list container (sawList is false) and no rows were extracted, it cannot distinguish 'no posts' from 'wrong page', so this CommandExecutionError is thrown instead of returning empty results.","triggerScenarios":"Extraction runs against a page without the expected Weibo posts list — redirected to login/verify, wrong profile URL, deleted or renamed user page, or a page that failed to render the list before the script ran.","commonSituations":"Expired session showing the login wall, uid that no longer exists, network truncating page load, or Weibo serving an anti-bot interstitial.","solutions":["Verify the user id/uid is correct and the profile page loads in a normal browser.","Refresh session cookies and retry (login walls lack the posts list).","Retry later if Weibo is serving an anti-crawler page; slow down request rates.","Ensure the page fully loads before extraction (stable network, no blocking proxies)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const res = await fetch(`https://weibo.com/u/${uid}`);\nif (!res.ok || res.url.includes('login') || res.url.includes('verify')) {\n  throw new Error('profile not publicly reachable; refresh session or check uid');\n}","typeGuard":"function looksLoggedOut(pageUrl) {\n  return /login|passport|verify/i.test(String(pageUrl));\n}","tryCatchPattern":"try {\n  const rows = await runUserPosts({ id: uid, start, end });\n} catch (err) {\n  if (err instanceof CommandExecutionError && /did not observe a valid posts list/.test(err.message)) {\n    // check uid, refresh cookies, or retry later\n  } else throw err;\n}","preventionTips":["Validate the uid against the live profile page first.","Maintain a fresh logged-in session.","Back off and retry when Weibo serves anti-crawler pages."],"tags":["weibo","empty-page","extraction"],"backgroundTag":"page-structure-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}