{"record":{"id":"3b1a21e99580afaf","repo":"santifer/career-ops","slug":"extracted-text-too-short-likely-blocked-or-empty","errorCode":null,"errorMessage":"Extracted text too short (likely blocked or empty)","messagePattern":"Extracted text too short \\(likely blocked or empty\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"batch-evaluate-gemini.mjs","lineNumber":266,"sourceCode":"  }\n}\n\nexport async function processOffer(browser, line, idx, _evaluate = evaluateWithRetry) {\n  const match = line.match(/- \\[\\s*\\]\\s+(https?:\\/\\/\\S+)(?:\\s*\\|\\s*([^|]+)\\s*\\|\\s*(.+))?/);\n  if (!match) return { line, processed: false };\n\n  const url = match[1];\n  let companyHint = match[2] ? match[2].trim() : 'Unknown';\n  let titleHint = match[3] ? match[3].trim() : 'Unknown';\n\n  console.log(`\\n========================================`);\n  console.log(`🔄 Processing [${idx}]: ${companyHint} - ${titleHint}`);\n  console.log(`🔗 URL: ${url}`);\n\n  try {\n    const jdText = await scrapeUrl(browser, url);\n    if (!jdText || jdText.length < 100) {\n      throw new Error('Extracted text too short (likely blocked or empty)');\n    }\n\n    console.log(`🧠 Calling Gemini (${modelName})...`);\n    const evaluationText = await _evaluate(`URL: ${url}\\n\\n${jdText}`);\n\n    // Parse output\n    const summaryMatch = evaluationText.match(/---SCORE_SUMMARY---\\s*([\\s\\S]*?)---END_SUMMARY---/);\n    if (!summaryMatch) {\n      console.error('Missing SCORE_SUMMARY block from model output:\\n' + evaluationText.slice(0, 500));\n      throw new Error('Missing SCORE_SUMMARY block from model output');\n    }\n    \n    const block = summaryMatch[1];\n    const extract = (key) => {\n      const m = block.match(new RegExp(`^\\\\s*${key}:\\\\s*(.+)$`, 'mi'));\n      return m ? m[1].trim() : 'unknown';\n    };\n","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/batch-evaluate-gemini.mjs#L248-L284","documentation":"Content sanity check in processOffer: scrapeUrl returned no text or fewer than 100 characters, so whatever loaded was not a real job description. Typical causes: bot detection/interstitial page, a JS-only render with no static text, a cookie/consent wall, or a dead posting that returns an empty shell.","triggerScenarios":"Thrown at batch-evaluate-gemini.mjs:266 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open the URL manually to confirm the posting still exists and isn't behind a bot check","Fetch the JD text via the ATS API instead (node fetch-jd.mjs) and feed it to the evaluator directly","Skip or remove the entry from the batch list if the posting is dead"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}