{"record":{"id":"b2912bca71ba824f","repo":"jackwener/OpenCLI","slug":"google-scholar-search","errorCode":"google-scholar/search","errorMessage":"Try a different query or check whether Google Scholar returned a CAPTCHA.","messagePattern":"Try a different query or check whether Google Scholar returned a CAPTCHA\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/google-scholar/search.js","lineNumber":69,"sourceCode":"            authors: authors.slice(0, 80),\n            source: source.slice(0, 60),\n            year,\n            cited,\n            url,\n          });\n          if (results.length >= ${limit}) break;\n        }\n        return { items: results, resultCount: resultCards.length };\n      })()\n    `);\n        if (!wrapper || typeof wrapper !== 'object' || !Array.isArray(wrapper.items)) {\n            throw new CommandExecutionError('Google Scholar search returned an unexpected payload shape');\n        }\n        if (wrapper.items.length === 0) {\n            if (Number(wrapper.resultCount) > 0) {\n                throw new CommandExecutionError('Google Scholar result cards were present but no rows could be extracted');\n            }\n            throw new EmptyResultError('google-scholar/search', 'Try a different query or check whether Google Scholar returned a CAPTCHA.');\n        }\n        return wrapper.items;\n    },\n});\n","sourceCodeStart":51,"sourceCodeEnd":74,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/google-scholar/search.js#L51-L74","documentation":"EmptyResultError (code `google-scholar/search`) thrown when the Scholar search page legitimately contains zero result cards: no items were extracted AND `resultCount` is 0. The hint tells the user the query simply matched nothing, or Scholar served a CAPTCHA instead of results.","triggerScenarios":"Calling `google-scholar search <query>` with a query that has no Scholar matches, or when the results page was replaced by a CAPTCHA/'unusual traffic' page so no `.gs_r.gs_or.gs_scl` cards exist at all.","commonSituations":"Overly narrow or malformed queries; heavy scraping triggering CAPTCHA walls; VPN/datacenter IPs flagged by Google; new papers not yet indexed.","solutions":["Broaden or rephrase the query and re-run.","Check whether scholar.google.com in a browser shows a CAPTCHA; if so, wait or switch IP/network.","Slow down request frequency if looping over many queries.","Handle EmptyResultError in your pipeline as a normal no-results case."],"exampleFix":"// before\nopencli run google-scholar search \"asdf qwerty zzz\"\n// after\nopencli run google-scholar search \"transformer attention is all you need\"","handlingStrategy":"try-catch","validationCode":"if (!query || query.trim().length < 3) {\n  console.warn('Query too narrow; EmptyResultError likely.');\n}","typeGuard":null,"tryCatchPattern":"try {\n  return await run('google-scholar search', query);\n} catch (e) {\n  if (e.name === 'EmptyResultError') return []; // expected: no matches or CAPTCHA\n  throw e;\n}","preventionTips":["Use specific but broad-enough query terms.","Throttle requests to avoid CAPTCHA walls.","Catch EmptyResultError as a normal no-results case.","Rotate IPs if CAPTchas appear frequently."],"tags":["scraping","google-scholar","empty-result","captcha"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}