jackwener/OpenCLI · error · CommandExecutionError

No profile found for: ${author}

Error message

No profile found for: ${author}

What it means

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.

Source

Thrown at clis/google-scholar/profile.js:36

    func: async (page, kwargs) => {
        const author = requireNonEmptyQuery(kwargs.author, 'author');
        const limit = clampInt(kwargs.limit, 10, 1, 20);

        const isUserId = /^[A-Za-z0-9_-]{12}$/.test(author);
        if (isUserId) {
            await page.goto(`https://scholar.google.com/citations?user=${author}&hl=en&sortby=citedby`);
        } else {
            await page.goto(`https://scholar.google.com/citations?view_op=search_authors&mauthors=${encodeURIComponent(author)}&hl=en`);
            await page.wait(3);

            const profileClicked = await page.evaluate(`(() => {
                var link = document.querySelector('.gs_ai_pho, .gsc_oai_photo, a[href*="citations?user="]');
                if (link) { link.click(); return true; }
                return false;
            })()`);

            if (!profileClicked) {
                throw new CommandExecutionError(`No profile found for: ${author}`);
            }
        }

        await page.wait(3);

        const data = await page.evaluate(`(() => {
            var name = (document.querySelector('#gsc_prf_in') || {}).textContent || '';
            var affiliation = (document.querySelector('.gsc_prf_il') || {}).textContent || '';

            var stats = document.querySelectorAll('#gsc_rsb_st td.gsc_rsb_std');
            var citations = stats[0] ? stats[0].textContent.trim() : '';
            var hIndex = stats[2] ? stats[2].textContent.trim() : '';
            var i10Index = stats[4] ? stats[4].textContent.trim() : '';

            var papers = [];
            var rows = document.querySelectorAll('#gsc_a_b .gsc_a_tr');
            for (var i = 0; i < rows.length && i < ${limit}; i++) {
                var titleEl = rows[i].querySelector('.gsc_a_at');

View on GitHub (pinned to 49907e53dc)

Solutions

  1. 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`.
  2. Retry with a different name form (initials, alternate spelling) or add an affiliation keyword, e.g. 'Yann LeCun NYU'.
  3. Re-run later or from a different network/IP if a CAPTCHA or bot-detection page was served.
  4. Verify the author actually has a Google Scholar profile via scholar.google.com/citations?view_op=search_authors in a browser.

Example fix

// before
opencli run google-scholar profile "A. M. Turing"
// after
opencli run google-scholar profile "QOAaS9kAAAAJ"  // 12-char Scholar user ID
Defensive patterns

Strategy: validation

Validate before calling

const SCHOLAR_USER_ID = /^[A-Za-z0-9_-]{12}$/;
if (!SCHOLAR_USER_ID.test(author)) {
  console.warn('Author is a name; pass a 12-char Scholar user ID for reliable lookup.');
}

Type guard

const isScholarUserId = (v) => typeof v === 'string' && /^[A-Za-z0-9_-]{12}$/.test(v);

Try / catch

try {
  await run('google-scholar profile', author);
} catch (e) {
  if (e instanceof CommandExecutionError && /No profile found/.test(e.message)) {
    // try alternate spelling or fetch the user ID first
  } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/0e205b96ac29059c. Report an issue: GitHub.