$npx -y skills add cookjohn/gs-skills --skill gs-navigate-pagesNavigate Google Scholar search result pages. Use when user wants to see more results or go to a specific page.
| 1 | # Google Scholar Navigate Pages |
| 2 | |
| 3 | Navigate search result pages. Requires context from a previous gs-search or gs-advanced-search call. |
| 4 | |
| 5 | ## Arguments |
| 6 | |
| 7 | $ARGUMENTS can be: |
| 8 | - `next` — go to next page |
| 9 | - `previous` — go to previous page |
| 10 | - `page N` — go to page N |
| 11 | |
| 12 | ## Prerequisites |
| 13 | |
| 14 | This skill requires context from a previous search: |
| 15 | - `currentUrl`: the current Google Scholar search URL |
| 16 | - `page`: current page number (1-based) |
| 17 | |
| 18 | ## Steps |
| 19 | |
| 20 | ### 1. Calculate new URL |
| 21 | |
| 22 | Google Scholar uses `start` parameter for pagination (0-indexed, increments of 10): |
| 23 | - Page 1: `start=0` (or omitted) |
| 24 | - Page 2: `start=10` |
| 25 | - Page 3: `start=20` |
| 26 | |
| 27 | Based on $ARGUMENTS: |
| 28 | - `next`: newStart = currentStart + 10 |
| 29 | - `previous`: newStart = max(0, currentStart - 10) |
| 30 | - `page N`: newStart = (N - 1) * 10 |
| 31 | |
| 32 | Modify the `start` parameter in the current search URL. If `start` doesn't exist in the URL, append `&start={newStart}`. |
| 33 | |
| 34 | ### 2. Navigate |
| 35 | |
| 36 | Use `mcp__chrome-devtools__navigate_page` with the updated URL. |
| 37 | |
| 38 | ### 3. Extract results (evaluate_script) |
| 39 | |
| 40 | Same extraction script as gs-search step 2: |
| 41 | |
| 42 | ```javascript |
| 43 | async () => { |
| 44 | for (let i = 0; i < 20; i++) { |
| 45 | if (document.querySelector('#gs_res_ccl') || document.querySelector('#gs_captcha_ccl')) break; |
| 46 | await new Promise(r => setTimeout(r, 500)); |
| 47 | } |
| 48 | |
| 49 | if (document.querySelector('#gs_captcha_ccl') || document.body.innerText.includes('unusual traffic')) { |
| 50 | return { error: 'captcha', message: 'Google Scholar requires CAPTCHA verification. Please complete it in your browser, then tell me to continue.' }; |
| 51 | } |
| 52 | |
| 53 | const items = document.querySelectorAll('#gs_res_ccl .gs_r.gs_or.gs_scl'); |
| 54 | const results = Array.from(items).map((item, i) => { |
| 55 | const titleEl = item.querySelector('.gs_rt a'); |
| 56 | const meta = item.querySelector('.gs_a')?.textContent || ''; |
| 57 | const parts = meta.split(' - '); |
| 58 | const authors = parts[0]?.trim() || ''; |
| 59 | const journalYear = parts[1]?.trim() || ''; |
| 60 | const citedByEl = item.querySelector('.gs_fl a[href*="cites"]'); |
| 61 | |
| 62 | return { |
| 63 | n: NEW_START + i + 1, |
| 64 | title: titleEl?.textContent?.trim() || item.querySelector('.gs_rt')?.textContent?.trim() || '', |
| 65 | href: titleEl?.href || '', |
| 66 | authors, |
| 67 | journalYear, |
| 68 | citedBy: citedByEl?.textContent?.match(/\d+/)?.[0] || '0', |
| 69 | citedByUrl: citedByEl?.href || '', |
| 70 | dataCid: item.getAttribute('data-cid') || '', |
| 71 | fullTextUrl: (item.querySelector('.gs_ggs a') || item.querySelector('.gs_or_ggsm a'))?.href || '', |
| 72 | snippet: item.querySelector('.gs_rs')?.textContent?.trim()?.substring(0, 200) || '' |
| 73 | }; |
| 74 | }); |
| 75 | |
| 76 | const totalText = document.querySelector('#gs_ab_md')?.textContent?.trim() || ''; |
| 77 | const hasNext = !!document.querySelector('#gs_n a.gs_ico_nav_next, #gs_nm a:last-child'); |
| 78 | const currentUrl = window.location.href; |
| 79 | return { total: totalText, page: NEW_PAGE, resultCount: results.length, hasNext, currentUrl, results }; |
| 80 | } |
| 81 | ``` |
| 82 | |
| 83 | Replace `NEW_START` and `NEW_PAGE` with the computed values. |
| 84 | |
| 85 | ### 4. Report |
| 86 | |
| 87 | ``` |
| 88 | Page {page} for "{query}" ({total}): |
| 89 | |
| 90 | 1. {title} |
| 91 | Authors: {authors} | {journalYear} |
| 92 | Cited by: {citedBy} |
| 93 | Data-CID: {dataCid} |
| 94 | |
| 95 | 2. ... |
| 96 | |
| 97 | {hasNext ? "More results available — ask me for the next page." : "No more results."} |
| 98 | ``` |
| 99 | |
| 100 | ## Notes |
| 101 | |
| 102 | - This skill uses 2 tool calls: `navigate_page` + `evaluate_script` |
| 103 | - Google Scholar shows 10 results per page by default |
| 104 | - `start` parameter controls pagination offset |