{"id":"google-search-serp","name":"google-search-serp","summary":"オーガニック検索結果、有料広告、関連検索、People Also Asking、AI概要テキスト、総結果数などを含むGoogle検索結果ページ(SERP)データを抽出 google.com。","body":"# Google — Search SERP Extraction\n\n> Search keyword + parameters → structured SERP data (organic results, ads, related queries, PAA, AI Overview)\n\n## Language\n\nAll process output to user (progress updates, process notifications) follows the user's language.\n\n## Objective\n\nExtract all visible content from a Google Search results page: organic listings, paid ads, related searches, People Also Ask, AI Overview, and total result count.\n\n## Prerequisites\n\n- Target page is already open in the browser: `https://www.google.com/search?q={query}`\n\n## Pre-execution Checks\n\n### 1. Tool Readiness\n\nIf browser-act has been confirmed available in the current session → skip this step.\n\nInvoke `browser-act` via Skill tool to load usage. If installation or configuration issues arise, follow its guidance to resolve then retry.\n\n## Capability Components\n\n> This Skill's operational boundary = what the user can manually do in their browser. It only reads data already displayed to the user on the page, never bypassing authentication or access controls. Its role is equivalent to copy-pasting on the user's behalf — the data is already on screen, automation merely saves time. JS code is encapsulated in Python files under the `scripts/` directory, invoked via `eval \"$(python scripts/xxx.py {params})\"`. `$(...)` is bash syntax; it is recommended to use the bash tool for execution.\n\nBelow are all atomic capabilities discovered and verified during the exploration phase, listed by command template with parameters. Simply invoke them as needed — no need to read `scripts/*.py` source code or re-verify. Only inspect scripts when execution fails for troubleshooting. Combine freely as needed during execution.\n\n### DOM: Google Search SERP (data extraction)\n\nParameters are injected via URL navigation; data is extracted from the server-rendered HTML page:\n\n1. `navigate https://www.google.com/search?q={query}&num={num}&hl={lang}&gl={country}&start={start}`\n2. `wait stable`\n3. `eval \"$(python scripts/serp-extract.py)\"`\n\nURL parameters:\n- `q`: Search query (required)\n- `num`: Results per page — `10` (default), `20`, `50`, `100`\n- `hl`: Interface language code — e.g., `en`, `zh-CN`, `fr`, `de` (omit for browser default)\n- `gl`: Country targeting code — e.g., `us`, `gb`, `de`, `cn` (omit for browser default)\n- `start`: Pagination offset — `0` for page 1, `10` for page 2 (when `num=10`); formula: `(page - 1) * num`\n\nError handling: If extraction returns `{\"error\": true, \"message\": \"captcha required\"}`, the session is blocked by Google — switch to a browser with a US rotating proxy and retry. If `\"No search results found\"` is returned, run `screenshot` to verify the page loaded correctly before retrying.\n\nOutput example:\n```json\n{\n  \"searchQuery\": {\n    \"term\": \"machine learning\",\n    \"url\": \"https://www.google.com/search?q=machine+learning\",\n    \"device\": \"DESKTOP\",\n    \"page\": 1,\n    \"type\": \"SEARCH\",\n    \"domain\": \"www.google.com\",\n    \"countryCode\": \"US\",\n    \"languageCode\": \"en\"\n  },\n  \"resultsTotal\": \"14900000000\",\n  \"organicResults\": [\n    {\n      \"position\": 1,\n      \"type\": \"organic\",\n      \"title\": \"Machine learning - Wikipedia\",\n      \"url\": \"https://en.wikipedia.org/wiki/Machine_learning\",\n      \"displayedUrl\": \"en.wikipedia.org › wiki › Machine_learning\",\n      \"description\": \"Machine learning (ML) is a field of study in artificial intelligence...\",\n      \"emphasizedKeywords\": [\"machine learning\", \"ML\"],\n      \"siteLinks\": [\n        {\"title\": \"Supervised learning\", \"url\": \"https://en.wikipedia.org/wiki/Supervised_learning\"}\n      ]\n    }\n  ],\n  \"paidResults\": [\n    {\n      \"adPosition\": 1,\n      \"type\": \"paid\",\n      \"title\": \"Learn Machine Learning Online\",\n      \"url\": \"https://example.com/ml-course\",\n      \"displayedUrl\": \"example.com\",\n      \"description\": null,\n      \"siteLinks\": []\n    }\n  ],\n  \"relatedQueries\": [\n    {\"title\": \"machine learning examples\", \"url\": \"https://www.google.com/search?q=machine+learning+examples\"}\n  ],\n  \"peopleAlsoAsk\": [\n    {\"question\": \"What is machine learning used for?\"}\n  ],\n  \"aiOverview\": null\n}\n```\n\nField notes:\n- `resultsTotal`: total result count string (commas removed), `null` when stat bar is absent\n- `organicResults[*].emphasizedKeywords`: bold/italic terms in the description, empty array when none\n- `organicResults[*].siteLinks`: sub-links shown under some results, empty array when none\n- `paidResults[*].description`: ad description text, `null` when the advertiser omits it\n- `aiOverview`: AI Overview paragraph text joined with spaces, `null` when absent or unavailable\n\n## Pagination\n\n**URL Pagination**: URL pattern `https://www.google.com/search?q={query}&num={num}&start={(page-1)*num}`. Increment `start` by `num` for each subsequent page. Termination: `organicResults` array is empty, or `start` exceeds the desired page count.\n\n## Success Criteria\n\n`organicResults.length >= 1` and `searchQuery.term` matches the requested keyword.\n\n## Known Limitations\n\n- **AI Overview unreliable in stealth sessions**: Google rarely serves AI Overview to automated browsers. `aiOverview` will be `null` in most sessions; it only populates when Google serves it without login or cookie context.\n- **Paid ad descriptions often null**: Many ads omit a description block — `paidResults[*].description` returns `null` for those. This reflects the advertiser's choice, not an extraction failure.\n- **Google anti-bot detection**: Stealth browsers may be redirected to a CAPTCHA (`/sorry/` page). Use a browser session with a US rotating proxy to reduce blocks. Solve any CAPTCHA manually via `remote-assist` if needed.\n- **Related queries load asynchronously**: `relatedQueries` requires `wait stable` after navigation; results may be empty if the page has not fully settled.\n\n## Execution Efficiency\n\n- **Batch orchestration**: Write a bash script to loop through keywords serially within one browser session; add a 2–5 second delay between requests to avoid triggering rate limits.\n- **Test before batch execution**: After writing a batch script, test with 1–2 keywords first to verify it runs correctly; only then run the full batch.\n- **Reduce redundant pre-operations**: Reuse the same browser session across multiple keywords — navigate directly to each search URL without returning to the homepage.\n- **Error resumption**: Save results keyword by keyword; on CAPTCHA or failure, resume from the breakpoint rather than starting over.\n- **Multi-session parallelism**: To increase throughput, open multiple stealth browser sessions (each with its own proxy fingerprint) and distribute keywords across them.\n\n## Experience Notes\n\nPath: `{working-directory}/browser-act-skill-forge-memories/google-search-scraper-google-search-serp.memory.md` (working directory is determined by the Agent running the Skill, typically the project root or current working directory)\n\n**Before execution**: If the file exists, read it first — it records unexpected situations encountered during past executions (e.g., a strategy has become ineffective); adjust strategy order accordingly.\n\n**After execution**: If an unexpected situation is encountered (strategy became ineffective, page redesigned, anti-scraping upgraded, better path discovered), append a line:\n`{YYYY-MM-DD}: {what happened} → {conclusion}`\n\nNormal execution does not write to the file. Do not record what keywords were used or how many results were returned — those are task outputs, not experience.","author":"@browser-act","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/browser-act/skills/tree/main/solutions/search-research/google-search-serp","license":"MIT","category":"writing","lang":"en","tokens":1713,"stars":0,"calls30d":2,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[{"path":"scripts/serp-extract.py","size":5270,"sha256":"32ea0724c9a006bf4a186cd5aa2a4f093537e1ff2da6af5aec5d43bd7121b49b"}],"requires":{"mcp":[],"tools":[]},"safety":{"flags":[{"code":"net.endpoints","kind":"exfiltration","excerpt":"www.google.com","message":"bundled scripts reach 1 external host(s)","severity":"warn"}],"scannedAt":"2026-08-22","hasScripts":true,"networkEndpoints":["www.google.com"]}}