{"record":{"id":"0e205b96ac29059c","repo":"jackwener/OpenCLI","slug":"no-profile-found-for-author","errorCode":null,"errorMessage":"No profile found for: ${author}","messagePattern":"No profile found for: (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/google-scholar/profile.js","lineNumber":36,"sourceCode":"    func: async (page, kwargs) => {\n        const author = requireNonEmptyQuery(kwargs.author, 'author');\n        const limit = clampInt(kwargs.limit, 10, 1, 20);\n\n        const isUserId = /^[A-Za-z0-9_-]{12}$/.test(author);\n        if (isUserId) {\n            await page.goto(`https://scholar.google.com/citations?user=${author}&hl=en&sortby=citedby`);\n        } else {\n            await page.goto(`https://scholar.google.com/citations?view_op=search_authors&mauthors=${encodeURIComponent(author)}&hl=en`);\n            await page.wait(3);\n\n            const profileClicked = await page.evaluate(`(() => {\n                var link = document.querySelector('.gs_ai_pho, .gsc_oai_photo, a[href*=\"citations?user=\"]');\n                if (link) { link.click(); return true; }\n                return false;\n            })()`);\n\n            if (!profileClicked) {\n                throw new CommandExecutionError(`No profile found for: ${author}`);\n            }\n        }\n\n        await page.wait(3);\n\n        const data = await page.evaluate(`(() => {\n            var name = (document.querySelector('#gsc_prf_in') || {}).textContent || '';\n            var affiliation = (document.querySelector('.gsc_prf_il') || {}).textContent || '';\n\n            var stats = document.querySelectorAll('#gsc_rsb_st td.gsc_rsb_std');\n            var citations = stats[0] ? stats[0].textContent.trim() : '';\n            var hIndex = stats[2] ? stats[2].textContent.trim() : '';\n            var i10Index = stats[4] ? stats[4].textContent.trim() : '';\n\n            var papers = [];\n            var rows = document.querySelectorAll('#gsc_a_b .gsc_a_tr');\n            for (var i = 0; i < rows.length && i < ${limit}; i++) {\n                var titleEl = rows[i].querySelector('.gsc_a_at');","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/google-scholar/profile.js#L18-L54","documentation":"The google-scholar profile command could not find a matching author-profile link on the Scholar author-search page. When the `author` argument is a name (not a 12-char Scholar user ID), the command opens `citations?view_op=search_authors` and clicks the first profile link (`.gs_ai_pho`, `.gsc_oai_photo`, or `a[href*=\"citations?user=\"]`). If no such element exists it throws this CommandExecutionError instead of navigating to a profile page.","triggerScenarios":"Calling `google-scholar profile <author>` with a name that (a) matches no author on Google Scholar, (b) is misspelled or uses a different transliteration, or (c) renders a page where Scholar shows 'no profiles match' / a CAPTCHA / a different layout so no clickable profile link selector matches.","commonSituations":"Typo in the author name; querying by full name when Scholar indexes an abbreviated form; non-Latin scripts not matching Scholar's index; Google serving a CAPTCHA or consent page (bot detection) so the author-search results page never renders; using a user ID shorter/longer than 12 chars so it is treated as a name.","solutions":["Look up the author's 12-character Scholar user ID (from the citations page URL) and pass that instead of the name, e.g. `google-scholar profile JicYPdAAAAAJ`.","Retry with a different name form (initials, alternate spelling) or add an affiliation keyword, e.g. 'Yann LeCun NYU'.","Re-run later or from a different network/IP if a CAPTCHA or bot-detection page was served.","Verify the author actually has a Google Scholar profile via scholar.google.com/citations?view_op=search_authors in a browser."],"exampleFix":"// before\nopencli run google-scholar profile \"A. M. Turing\"\n// after\nopencli run google-scholar profile \"QOAaS9kAAAAJ\"  // 12-char Scholar user ID","handlingStrategy":"validation","validationCode":"const SCHOLAR_USER_ID = /^[A-Za-z0-9_-]{12}$/;\nif (!SCHOLAR_USER_ID.test(author)) {\n  console.warn('Author is a name; pass a 12-char Scholar user ID for reliable lookup.');\n}","typeGuard":"const isScholarUserId = (v) => typeof v === 'string' && /^[A-Za-z0-9_-]{12}$/.test(v);","tryCatchPattern":"try {\n  await run('google-scholar profile', author);\n} catch (e) {\n  if (e instanceof CommandExecutionError && /No profile found/.test(e.message)) {\n    // try alternate spelling or fetch the user ID first\n  } else throw e;\n}","preventionTips":["Prefer 12-character Scholar user IDs over names.","Verify the author has a Scholar profile in a browser before scripting.","Use canonical name spelling plus affiliation keywords."],"tags":["scraping","browser","google-scholar","not-found"],"backgroundTag":"scraper-element-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}