santifer/career-ops · error · Error
Extracted text too short (likely blocked or empty)
Error message
Extracted text too short (likely blocked or empty)
What it means
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.
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
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at batch-evaluate-gemini.mjs:266 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of santifer/career-ops@aac998c7ed (2026-09-16).
Data as JSON: /api/errors/3b1a21e99580afaf.
Report an issue: GitHub.
Appendix: source
Thrown at batch-evaluate-gemini.mjs:266
}
}
export async function processOffer(browser, line, idx, _evaluate = evaluateWithRetry) {
const match = line.match(/- \[\s*\]\s+(https?:\/\/\S+)(?:\s*\|\s*([^|]+)\s*\|\s*(.+))?/);
if (!match) return { line, processed: false };
const url = match[1];
let companyHint = match[2] ? match[2].trim() : 'Unknown';
let titleHint = match[3] ? match[3].trim() : 'Unknown';
console.log(`\n========================================`);
console.log(`🔄 Processing [${idx}]: ${companyHint} - ${titleHint}`);
console.log(`🔗 URL: ${url}`);
try {
const jdText = await scrapeUrl(browser, url);
if (!jdText || jdText.length < 100) {
throw new Error('Extracted text too short (likely blocked or empty)');
}
console.log(`🧠 Calling Gemini (${modelName})...`);
const evaluationText = await _evaluate(`URL: ${url}\n\n${jdText}`);
// Parse output
const summaryMatch = evaluationText.match(/---SCORE_SUMMARY---\s*([\s\S]*?)---END_SUMMARY---/);
if (!summaryMatch) {
console.error('Missing SCORE_SUMMARY block from model output:\n' + evaluationText.slice(0, 500));
throw new Error('Missing SCORE_SUMMARY block from model output');
}
const block = summaryMatch[1];
const extract = (key) => {
const m = block.match(new RegExp(`^\\s*${key}:\\s*(.+)$`, 'mi'));
return m ? m[1].trim() : 'unknown';
};
View on GitHub (pinned to aac998c7ed)