{"record":{"id":"405f86601c1968a7","repo":"jackwener/OpenCLI","slug":"no-koubei-data-found-the-series-id-may-be-wrong","errorCode":null,"errorMessage":"No koubei data found — the series id may be wrong, or Autohome changed its page.","messagePattern":"No koubei data found — the series id may be wrong, or Autohome changed its page\\.","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/autohome/score.js","lineNumber":88,"sourceCode":"\ncli({\n    site: 'autohome',\n    name: 'score',\n    access: 'read',\n    aliases: ['koubei', 'rating'],\n    description: '汽车之家车系口碑评分（总分 + 各维度 + 故障率PPH + 竞品对比，免登录）',\n    strategy: Strategy.PUBLIC,\n    browser: false,\n    args: [\n        { name: 'series_id', required: true, positional: true, help: '车系 ID（来自 brand 的 series_id，或 k.autohome.com.cn/<id> URL）' },\n    ],\n    columns: SCORE_COLUMNS,\n    func: async (args) => {\n        const seriesId = normalizeSeriesId(args.series_id);\n        const html = await ahFetch(`${AH_KOUBEI_BASE}/${seriesId}`, `score ${seriesId}`);\n        const pp = extractPageProps(html);\n        if (!pp) {\n            throw new CommandExecutionError(\n                `autohome score ${seriesId}`,\n                'No koubei data found — the series id may be wrong, or Autohome changed its page.',\n            );\n        }\n        const rows = parseScore(pp, seriesId);\n        const map = Object.fromEntries(rows.map((r) => [r.field, r.value]));\n        if (!map.name && map.overall == null) {\n            throw new EmptyResultError(\n                `autohome score ${seriesId}`,\n                'This series has no koubei rating yet.',\n            );\n        }\n        return rows;\n    },\n});\n","sourceCodeStart":70,"sourceCodeEnd":104,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/autohome/score.js#L70-L104","documentation":"CommandExecutionError thrown by the autohome score command when extractPageProps cannot locate the __PAGE_PROPS__-style data blob in the fetched koubei page. Without that embedded JSON the parser has nothing to read, so the library fails fast rather than returning garbage.","triggerScenarios":"ahFetch succeeded for AH_KOUBEI_BASE/<seriesId> but the HTML lacks page props: wrong/nonexistent series id leading to an error page, an anti-bot/redirect page, or Autohome changing how koubei data is embedded.","commonSituations":"Using a series id copied from a URL fragment that isn't the koubei series id; ids scraped long ago that no longer exist; Autohome A/B-testing a new page layout without the props script.","solutions":["Verify the series id by opening the series page on autohome.com.cn and confirming koubei ratings exist there.","Re-derive the id from a current autohome series URL rather than an old bookmark.","Retry later or from a different IP if an anti-bot page was served.","If the markup changed, inspect the live page and update extractPageProps to the new data container."],"exampleFix":"// before\nopencli autohome score 99999999   // nonexistent id -> error page\n// after\nopencli autohome score 4348      // valid series id with koubei data","handlingStrategy":"try-catch","validationCode":"if (!Number.isInteger(Number(seriesId)) || Number(seriesId) <= 0) {\n  throw new Error('series_id must be a positive numeric autohome id');\n}","typeGuard":"function isValidSeriesId(v) {\n  return /^\\d+$/.test(String(v).trim());\n}","tryCatchPattern":"try {\n  const rows = await score(seriesId);\n} catch (e) {\n  if (/No koubei data found/.test(e.message)) {\n    console.error(`Series ${seriesId} has no koubei page — verify the id on autohome.com.cn`);\n  } else throw e;\n}","preventionTips":["Extract series ids from current autohome.com.cn URLs, not old bookmarks.","Open the series page in a browser to confirm koubei data exists before scripting.","Handle upstream layout changes by keeping the scraping layer isolated and tested."],"tags":["scraping","html-parsing","upstream-change"],"backgroundTag":"unexpected-page-structure","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}