{"record":{"id":"35db4cff9b5209f8","repo":"jackwener/OpenCLI","slug":"not-found-35db4c","errorCode":"NOT_FOUND","errorMessage":"No search results found","messagePattern":"No search results found","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"error","filePath":"clis/google/search.js","lineNumber":134,"sourceCode":"        var paaContainers = document.querySelectorAll('[data-sgrd=\"true\"]');\n        for (var i = 0; i < paaContainers.length; i++) {\n          var questionEl = paaContainers[i].querySelector('span.CSkcDe');\n          if (questionEl) {\n            results.push({\n              type: 'paa',\n              title: questionEl.textContent.trim(),\n              url: '',\n              snippet: '',\n            });\n          }\n        }\n\n        return {items: results};\n      })()\n    `);\n        const results = (wrapper && wrapper.items) || [];\n        if (results.length === 0) {\n            throw new CliError('NOT_FOUND', 'No search results found', 'Try a different keyword or check for CAPTCHA');\n        }\n        return results;\n    },\n});\n","sourceCodeStart":116,"sourceCodeEnd":139,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/google/search.js#L116-L139","documentation":"The google search CLI command executes an in-page wrapper script (browser evaluate) and throws this CliError with code NOT_FOUND when the extracted results array is empty. The hint 'Try a different keyword or check for CAPTCHA' reflects that empty extraction usually means either a genuinely resultless query or Google showing a CAPTCHA page that the wrapper silently parsed as zero results.","triggerScenarios":"The browser-evaluate wrapper returns undefined or wrapper.items is an empty array after scraping a Google SERP — due to a query with no results, an unrendered page, or a CAPTCHA/consent page replacing the SERP.","commonSituations":"Bot detection serving a 'sorry' page so selectors find nothing; page.evaluate running before search results render; extremely rare keyword returning zero organic results; Google layout change breaking the wrapper's selectors.","solutions":["Re-run with a different or broader keyword to rule out a genuinely empty result set","Check for a CAPTCHA/consent page before treating empty extraction as NOT_FOUND (like the images command does)","Add a wait for result containers before running the wrapper so the page finishes rendering","Update the wrapper's selectors if Google changed the SERP markup"],"exampleFix":"// before\nconst results = (wrapper && wrapper.items) || [];\nif (results.length === 0) throw new CliError('NOT_FOUND', 'No search results found', '...');\n// after\nconst state = await evaluatePageState(page);\nif (state.captchaOrConsent) throw new CliError('BLOCKED', 'Google CAPTCHA detected', 'Solve CAPTCHA or change IP');\nconst results = (wrapper && wrapper.items) || [];","handlingStrategy":"try-catch","validationCode":"// validate keyword before invoking\nif (!keyword || typeof keyword !== 'string') throw new Error('keyword required');","typeGuard":"function isBlockedByCaptcha(pageHtml) {\n  return typeof pageHtml === 'string' && /captcha|unusual traffic|consent/i.test(pageHtml);\n}","tryCatchPattern":"try {\n  const results = await searchCommand.func(args);\n} catch (e) {\n  if (e.code === 'NOT_FOUND') {\n    console.warn('Empty SERP — check for CAPTCHA or try another keyword');\n    return [];\n  }\n  throw e;\n}","preventionTips":["Rotate IPs / use residential proxies to avoid Google bot pages","Check page state for CAPTCHA before treating empty as no-results","Wait for SERP render before evaluating the wrapper","Broaden the keyword when a niche query returns nothing"],"tags":["scraping","google","empty-result","not-found"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}