$npx -y skills add cookjohn/gs-skills --skill gs-searchSearch Google Scholar for academic papers by keywords. Returns results with title, authors, journal, year, citation count, and full-text links. Use when the user wants to search Google Scholar.
| 1 | # Google Scholar Basic Search |
| 2 | |
| 3 | Search Google Scholar for papers using keyword(s). Returns structured result list via DOM scraping. |
| 4 | |
| 5 | ## Arguments |
| 6 | |
| 7 | $ARGUMENTS contains the search keyword(s). |
| 8 | |
| 9 | ## Steps |
| 10 | |
| 11 | ### 1. Navigate |
| 12 | |
| 13 | Use `mcp__chrome-devtools__navigate_page`: |
| 14 | - url: `https://scholar.google.com/scholar?q={URL_ENCODED_KEYWORDS}&hl=en&num=10` |
| 15 | |
| 16 | ### 2. Extract results (evaluate_script) |
| 17 | |
| 18 | Wait for results to load, check for CAPTCHA, then scrape the DOM: |
| 19 | |
| 20 | ```javascript |
| 21 | async () => { |
| 22 | // Wait for results or CAPTCHA |
| 23 | for (let i = 0; i < 20; i++) { |
| 24 | if (document.querySelector('#gs_res_ccl') || document.querySelector('#gs_captcha_ccl')) break; |
| 25 | await new Promise(r => setTimeout(r, 500)); |
| 26 | } |
| 27 | |
| 28 | // CAPTCHA check |
| 29 | if (document.querySelector('#gs_captcha_ccl') || document.body.innerText.includes('unusual traffic')) { |
| 30 | return { error: 'captcha', message: 'Google Scholar requires CAPTCHA verification. Please complete it in your browser, then tell me to continue.' }; |
| 31 | } |
| 32 | |
| 33 | const items = document.querySelectorAll('#gs_res_ccl .gs_r.gs_or.gs_scl'); |
| 34 | const results = Array.from(items).map((item, i) => { |
| 35 | const titleEl = item.querySelector('.gs_rt a'); |
| 36 | const meta = item.querySelector('.gs_a')?.textContent || ''; |
| 37 | // Parse "Author1, Author2 - Journal, Year - publisher" |
| 38 | const parts = meta.split(' - '); |
| 39 | const authors = parts[0]?.trim() || ''; |
| 40 | const journalYear = parts[1]?.trim() || ''; |
| 41 | const citedByEl = item.querySelector('.gs_fl a[href*="cites"]'); |
| 42 | const relatedEl = item.querySelector('.gs_fl a[href*="related"]'); |
| 43 | const versionsEl = item.querySelector('.gs_fl a[href*="cluster"]'); |
| 44 | |
| 45 | return { |
| 46 | n: i + 1, |
| 47 | title: titleEl?.textContent?.trim() || item.querySelector('.gs_rt')?.textContent?.trim() || '', |
| 48 | href: titleEl?.href || '', |
| 49 | authors, |
| 50 | journalYear, |
| 51 | citedBy: citedByEl?.textContent?.match(/\d+/)?.[0] || '0', |
| 52 | citedByUrl: citedByEl?.href || '', |
| 53 | dataCid: item.getAttribute('data-cid') || '', |
| 54 | fullTextUrl: (item.querySelector('.gs_ggs a') || item.querySelector('.gs_or_ggsm a'))?.href || '', |
| 55 | snippet: item.querySelector('.gs_rs')?.textContent?.trim()?.substring(0, 200) || '', |
| 56 | relatedUrl: relatedEl?.href || '', |
| 57 | versionsUrl: versionsEl?.href || '', |
| 58 | versions: versionsEl?.textContent?.match(/\d+/)?.[0] || '' |
| 59 | }; |
| 60 | }); |
| 61 | |
| 62 | const totalText = document.querySelector('#gs_ab_md')?.textContent?.trim() || ''; |
| 63 | const currentUrl = window.location.href; |
| 64 | return { total: totalText, resultCount: results.length, currentUrl, results }; |
| 65 | } |
| 66 | ``` |
| 67 | |
| 68 | ### 3. Report |
| 69 | |
| 70 | Present results as a numbered list: |
| 71 | |
| 72 | ``` |
| 73 | Searched Google Scholar for "$ARGUMENTS": {total} |
| 74 | |
| 75 | 1. {title} |
| 76 | Authors: {authors} | {journalYear} |
| 77 | Cited by: {citedBy} | [Full text]({fullTextUrl}) |
| 78 | Data-CID: {dataCid} |
| 79 | |
| 80 | 2. ... |
| 81 | ``` |
| 82 | |
| 83 | Always show the `dataCid` — it's the unique identifier used for citation export and "cited by" tracking. |
| 84 | |
| 85 | If `fullTextUrl` is available, highlight it (means open-access PDF/HTML). |
| 86 | |
| 87 | ### 4. Follow-up |
| 88 | |
| 89 | When the user wants to: |
| 90 | - **See more results**: use `gs-navigate-pages` to go to next page |
| 91 | - **See who cited a paper**: use `gs-cited-by` with the data-cid |
| 92 | - **Export to Zotero**: use `gs-export` with the data-cid(s) |
| 93 | |
| 94 | ## CAPTCHA Handling |
| 95 | |
| 96 | If the result contains `{error: 'captcha'}`: |
| 97 | 1. Tell the user: "Google Scholar is requesting CAPTCHA verification. Please complete it in your browser." |
| 98 | 2. Wait for user confirmation |
| 99 | 3. Retry the evaluate_script extraction |
| 100 | |
| 101 | ## Notes |
| 102 | |
| 103 | - This skill uses 2 tool calls: `navigate_page` + `evaluate_script` |
| 104 | - Google Scholar has NO public API — all data extraction is via DOM scraping |
| 105 | - `data-cid` is the primary identifier (cluster ID) — used across all GS skills |
| 106 | - Keep request frequency low to avoid triggering CAPTCHA |
| 107 | - Default `num=10` results per page (max 20) |