{"record":{"id":"9f899e60d98cf1be","repo":"jackwener/OpenCLI","slug":"no-rows-were-found-in-the-visible-hltv-page","errorCode":null,"errorMessage":"No rows were found in the visible HLTV page","messagePattern":"No rows were found in the visible HLTV page","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/hltv/utils.js","lineNumber":853,"sourceCode":"  if (!Array.isArray(matrix)) return [];\n  return matrix;\n}\n\nexport async function gotoAndWait(page, url, selector, label) {\n  try {\n    await page.goto(url.toString(), { waitUntil: 'domcontentloaded', settleMs: 1000, timeout: 20000 });\n    await page.wait({ selector, timeout: 15000 });\n  } catch (error) {\n    if (/timeout/i.test(String(error?.message ?? error))) {\n      throw new TimeoutError(label, 15);\n    }\n    throw new CommandExecutionError(`${label} failed: ${error?.message ?? error}`);\n  }\n}\n\nexport function assertRows(rows, command) {\n  if (!Array.isArray(rows)) throw new CommandExecutionError(`${command} parser returned an unexpected shape`);\n  if (rows.length === 0) throw new EmptyResultError(command, 'No rows were found in the visible HLTV page');\n  return rows;\n}\n\nexport function assertRequiredFields(rows, command, fields) {\n  assertRows(rows, command);\n  for (const [index, row] of rows.entries()) {\n    for (const field of fields) {\n      if (row?.[field] === null || row?.[field] === undefined || row?.[field] === '') {\n        throw new CommandExecutionError(`${command} parser returned row ${index + 1} without required ${field}`);\n      }\n    }\n  }\n  return rows;\n}\n","sourceCodeStart":835,"sourceCodeEnd":868,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/hltv/utils.js#L835-L868","documentation":"assertRows throws EmptyResultError(command, 'No rows were found in the visible HLTV page') when the parser returned a valid array that is empty. The page loaded but no matching rows were extracted, usually because there is genuinely no data or the selectors no longer match.","triggerScenarios":"An HLTV query with filters that match nothing (e.g. no events in range), or selectors failing to match after an HLTV markup change so zero rows are extracted.","commonSituations":"Filtering rankings/events too narrowly (top50 on a sparse period, rare map filters), a team/player with no recorded matches, or scraping right after an HLTV site update.","solutions":["Relax or remove filters (event type, maps, date range) and retry","Verify in a browser that the HLTV page actually shows data for the query","If the page visibly has data, update the parser selectors for the new markup","Handle EmptyResultError explicitly as 'no data' rather than a hard failure"],"exampleFix":"// before\nconst rows = assertRows(parseRankings(doc), 'rankings');\n// after\ntry {\n  const rows = assertRows(parseRankings(doc), 'rankings');\n} catch (err) {\n  if (err instanceof EmptyResultError) return [];\n  throw err;\n}","handlingStrategy":"try-catch","validationCode":"const rows = parseRows(doc);\nif (Array.isArray(rows) && rows.length === 0) {\n  console.warn(`${command}: no rows parsed — check filters or HLTV markup`);\n}","typeGuard":"function hasRows(value) {\n  return Array.isArray(value) && value.length > 0;\n}","tryCatchPattern":"try {\n  const rows = assertRows(parseRows(doc), command);\n} catch (err) {\n  if (err instanceof EmptyResultError) {\n    console.warn(`${err.command}: ${err.message}`);\n    return [];\n  }\n  throw err;\n}","preventionTips":["Start with broad filters and narrow gradually to avoid empty results","Treat EmptyResultError as 'no data', not a crash, in scripts","Verify in a browser that the HLTV page shows data for your query","Watch for HLTV redesigns that silently zero out parser output"],"tags":["empty-result","scraping","parsing"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}