{"record":{"id":"80945b97b1f802e3","repo":"jackwener/OpenCLI","slug":"no-yahoo-results-matched-query","errorCode":null,"errorMessage":"No Yahoo results matched \"${query}\".","messagePattern":"No Yahoo results matched \"(.+?)\"\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/yahoo/search.js","lineNumber":80,"sourceCode":"  ],\n  columns: ['rank', 'title', 'url', 'snippet'],\n  func: async (page, kwargs) => {\n    const limit = requireBoundedInteger(kwargs.limit, 7, 1, 7, '--limit');\n    const query = requireSearchQuery(kwargs.keyword);\n    const keyword = encodeURIComponent(query);\n    const pageNum = requireBoundedInteger(kwargs.page, 1, 1, 100, '--page');\n    var url = `https://search.yahoo.com/search?p=${keyword}`;\n    if (pageNum > 1) url += `&b=${(pageNum - 1) * 7 + 1}`;\n    await runBrowserStep('yahoo search navigation', () => page.goto(url));\n    try {\n      await page.wait({ selector: '.algo', timeout: 10 });\n    } catch {\n      await page.wait(3).catch(function() {});\n    }\n    const raw = await runBrowserStep('yahoo search extraction', () => page.evaluate(buildExtractorJs(limit)));\n    const results = requireRows(raw, 'yahoo search');\n    if (results.length === 0) {\n      throw emptySearchResults('Yahoo', query);\n    }\n    const rows = results\n      .map(function(r, index) {\n        return { rank: index + 1 + (pageNum - 1) * 7, title: r[0], url: decodeYahooUrl(r[1]), snippet: r[2] };\n      })\n      .filter((row) => row.url);\n    if (rows.length === 0) throw emptySearchResults('Yahoo', query);\n    return rows;\n  },\n});\n\nexport const __test__ = { command };\n","sourceCodeStart":62,"sourceCodeEnd":93,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/yahoo/search.js#L62-L93","documentation":"The Yahoo search page was scraped successfully but the extractor returned zero usable rows, so the CLI throws emptySearchResults to signal that the query genuinely produced no results (or the page layout broke extraction). Thrown before any rows are built.","triggerScenarios":"Running the yahoo search command when page.evaluate(buildExtractorJs) returns an empty array for the given query and page number.","commonSituations":"Very obscure or nonsense query with no Yahoo results; heavy result filtering; Yahoo serving a consent/anti-bot page that renders no result nodes; region-restricted results.","solutions":["Retry with a broader or correctly-spelled query","Retry later or from a different network/region in case Yahoo served an anti-bot or consent interstitial","Check the extractor selectors against current Yahoo DOM if all queries now return empty","Reduce --limit or check pagination parameters so the requested page exists"],"exampleFix":"// before: failing hard on empty results\nconst rows = requireRows(raw, 'yahoo search');\nif (rows.length === 0) throw emptySearchResults('Yahoo', query);\n// after: caller-side graceful handling\ntry {\n  const rows = await yahooSearch(query);\n} catch (e) {\n  if (/No Yahoo results/.test(e.message)) return [];\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"// no pre-call validation possible; optionally pre-check query non-empty\nif (!query || !query.trim()) throw new Error('Query must be non-empty');","typeGuard":"function hasResults(raw) {\n  return Array.isArray(raw) && raw.length > 0;\n}","tryCatchPattern":"try {\n  const rows = await yahooSearch(query, limit);\n} catch (e) {\n  if (e instanceof EmptySearchResultError || /No Yahoo results/.test(e.message)) return [];\n  throw e;\n}","preventionTips":["Catch emptySearchResults separately from network/selector failures","Test extractor selectors periodically against live Yahoo markup","Detect consent/anti-bot pages before extraction and back off","Offer a fallback search engine for zero-result queries"],"tags":["scraping","empty-results","yahoo"],"backgroundTag":"empty-search-results","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}