{"record":{"id":"5bb361159fea50b4","repo":"santifer/career-ops","slug":"careerviet-url-still-contains-job-cards-but-no","errorCode":null,"errorMessage":"careerviet: ${url} still contains job cards but none could be parsed — the listing markup changed","messagePattern":"careerviet: (.+?) still contains job cards but none could be parsed — the listing markup changed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"providers/careerviet.mjs","lineNumber":284,"sourceCode":"    });\n  }\n\n  return [...byId.values()];\n}\n\n/**\n * A listing page that parses to nothing is either a markup change or a block\n * — both are failures, and both must be reported. Returning [] would show up\n * as a board with no openings, indistinguishable from a healthy quiet board.\n *\n * The emptiness test is the card-marker SHAPE (a job-item DOM id) rather than\n * a marker word, so it survives the board's own \"no results\" copy changing.\n * @param {string} html\n * @param {string} url\n */\nexport function assertParsedSomething(html, url) {\n  if (!/id=[\"']job-item-[A-Za-z0-9]+[\"']/.test(String(html ?? ''))) return;\n  throw new Error(\n    `careerviet: ${url} still contains job cards but none could be parsed — the listing markup changed`,\n  );\n}\n\n/** @type {Provider} */\nexport default {\n  id: 'careerviet',\n\n  detect(entry) {\n    return entry?.provider === 'careerviet' ? { url: buildListUrl(entry, 1) } : null;\n  },\n\n  async fetch(entry, ctx) {\n    // `max_pages` on the portals entry is the user's setting; `ctx.maxPages` is a\n    // caller-side bound — verify-portals' health probe passes 1. Same shape as itviec.mjs.\n    const entryMaxPages = Number.isInteger(entry?.max_pages) && entry.max_pages > 0\n      ? Math.min(entry.max_pages, MAX_PAGES_CAP)\n      : DEFAULT_MAX_PAGES;","sourceCodeStart":266,"sourceCodeEnd":302,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/providers/careerviet.mjs#L266-L302","documentation":"careerviet's listing parser found job-card markers (`id=\"job-item-...\"`) in the fetched HTML but extracted zero postings from them. The provider throws this instead of returning an empty array so that a markup change or anti-bot block is reported as a failure rather than silently showing the board as 'no openings', which would be indistinguishable from a healthy quiet board.","triggerScenarios":"The careerviet.vn listing page HTML still contains elements whose DOM id matches /job-item-[A-Za-z0-9]+/, but the card-parsing regexes (title/href extraction, COMPANY_RE, LOCATION_RE, window-open URL shapes) no longer match the surrounding markup — e.g. the board changed its card template, class names, or how job links are embedded.","commonSituations":"Careerviet redesigns its job-listing template or A/B tests a new card layout; a CDN or bot-protection layer rewrites the page; portals.yml is fine but the scraper's assumptions are stale after months of upstream drift.","solutions":["Open the URL in a browser and inspect the current job-card markup (ids, classes, href shape)","Update the parsing regexes in providers/careerviet.mjs to match the new card structure","Verify with a small Node script that parseListings extracts the same cards the marker regex finds","If the page is being served an anti-bot variant, route fetching through the Playwright path instead of plain HTTP"],"exampleFix":"// before: parse regex expecting old anchor shape\nconst ANCHOR_RE = /job-item-[\\w]+[^>]*>\\s*<a[^>]*href=\"([^\"]+)\"/;\n// after: match the redesigned card where the link is a sibling\nconst ANCHOR_RE = /id=[\"']job-item-[A-Za-z0-9]+[\"'][\\s\\S]{0,400}?<a[^>]+href=[\"']([^\"'#]+)[\"']/;","handlingStrategy":"try-catch","validationCode":"// Probe the fetched HTML before relying on parsed results\nfunction looksLikeJobListing(html) {\n  return typeof html === 'string' && /id=[\"']job-item-[A-Za-z0-9]+[\"']/.test(html);\n}\n// If looksLikeJobListing(html) && parsed.length === 0 -> markup drifted; alert instead of treating as empty\n","typeGuard":"function hasJobCards(html) {\n  return typeof html === 'string' && /id=[\"']job-item-[A-Za-z0-9]+[\"']/.test(html);\n}","tryCatchPattern":"try {\n  const jobs = await provider.fetch(entry, ctx);\n} catch (err) {\n  if (String(err.message).includes('still contains job cards but none could be parsed')) {\n    // markup change: flag board for maintenance, do NOT record as empty/quiet board\n  } else { throw err; }\n}","preventionTips":["Pin a snapshot test of a real careerviet listing page so parser regressions fail in CI, not in production scans","Treat an empty parse of a card-bearing page as an alert, never as 'no openings'","Check the live board periodically (e.g. audit-portals) to catch template redesigns early","Keep parsing regexes tolerant to class-name churn by keying on stable DOM id shapes like job-item-*"],"tags":["web-scraping","markup-change","html-parsing"],"backgroundTag":"unexpected-response-shape","analyzedSha":"aac998c7ed7248ea853b720ceeb1fdbeb322fc5d","analyzedAt":"2026-09-16T06:35:29.214Z","contentChangedAt":"2026-09-16T06:35:29.214Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}