google-browser-scraper 0.1.0__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. {google_browser_scraper-0.1.0/src/google_browser_scraper.egg-info → google_browser_scraper-0.1.2}/PKG-INFO +183 -119
  2. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/README.md +182 -118
  3. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/pyproject.toml +1 -1
  4. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper/__init__.py +1 -1
  5. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper/cli.py +18 -16
  6. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper/hybrid.py +65 -0
  7. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper/links.py +87 -2
  8. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper/quality.py +7 -5
  9. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper/scraper.py +31 -7
  10. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2/src/google_browser_scraper.egg-info}/PKG-INFO +183 -119
  11. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/tests/test_hybrid.py +59 -2
  12. google_browser_scraper-0.1.2/tests/test_links.py +273 -0
  13. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/tests/test_scraper.py +36 -0
  14. google_browser_scraper-0.1.0/tests/test_links.py +0 -112
  15. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/LICENSE +0 -0
  16. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/MANIFEST.in +0 -0
  17. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/setup.cfg +0 -0
  18. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper/__main__.py +0 -0
  19. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper/browser.py +0 -0
  20. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper/classify.py +0 -0
  21. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper/doctor.py +0 -0
  22. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper/engines.py +0 -0
  23. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper/mcp.py +0 -0
  24. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper/output.py +0 -0
  25. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper/parse.py +0 -0
  26. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper/pool.py +0 -0
  27. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper/proxy.py +0 -0
  28. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper/relay.py +0 -0
  29. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper/server.py +0 -0
  30. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper/warmup.py +0 -0
  31. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper.egg-info/SOURCES.txt +0 -0
  32. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper.egg-info/dependency_links.txt +0 -0
  33. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper.egg-info/entry_points.txt +0 -0
  34. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper.egg-info/requires.txt +0 -0
  35. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/src/google_browser_scraper.egg-info/top_level.txt +0 -0
  36. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/tests/fakegoogle.py +0 -0
  37. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/tests/pages.py +0 -0
  38. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/tests/stdio_mcp_child.py +0 -0
  39. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/tests/test_browser_local.py +0 -0
  40. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/tests/test_classify.py +0 -0
  41. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/tests/test_cli_and_output.py +0 -0
  42. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/tests/test_engines_local.py +0 -0
  43. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/tests/test_parse.py +0 -0
  44. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/tests/test_pool.py +0 -0
  45. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/tests/test_proxy.py +0 -0
  46. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/tests/test_relay.py +0 -0
  47. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/tests/test_serve_and_mcp.py +0 -0
  48. {google_browser_scraper-0.1.0 → google_browser_scraper-0.1.2}/tests/test_warmup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-browser-scraper
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Google Search results from a real browser through your own sticky proxy, with captchas and blocks reported explicitly.
5
5
  Author: NodeMaven
6
6
  License: MIT
@@ -47,7 +47,7 @@ Dynamic: license-file
47
47
 
48
48
  <a href="https://devhunt.org/tool/google-search-scraper"><img src="https://devhunt.org/badge/google-search-scraper.svg" alt="Google Browser Scraper on DevHunt" height="44"></a>
49
49
 
50
- [Quickstart](#quickstart) · [Output](#what-you-get) · [HTTP API](#run-it-as-an-api) · [MCP](#use-it-from-an-ai-agent-mcp) · [Docker](#docker) · [How it works](#how-it-works) · [Options](#options)
50
+ [Quickstart](#quickstart) · [Output](#what-you-get) · [Poisoned results](#poisoned-results-protection) · [HTTP API](#run-it-as-an-api) · [MCP](#use-it-from-an-ai-agent-mcp) · [Docker](#docker) · [How it works](#how-it-works) · [Options](#options)
51
51
 
52
52
  </div>
53
53
 
@@ -57,41 +57,86 @@ Dynamic: license-file
57
57
  <img src="https://raw.githubusercontent.com/nodemaven/google-browser-scraper/main/assets/demo.gif" alt="A real Chrome window showing Google results next to the JSON the scraper produced for them" width="900">
58
58
  </p>
59
59
 
60
- **Latest version benchmarks (v0.1):**
60
+ <div align="center">
61
+
62
+ | ✅ **100%** | 📉 **0.4 MB** | ⚡ **1.4 s** |
63
+ |:---:|:---:|:---:|
64
+ | success rate | per search | per search on a warm proxy IP |
65
+
66
+ <sub>Latest version benchmarks (v0.1)</sub>
61
67
 
62
- - 99.6% success rate (548 of 550 searches)
63
- - 0.4 MB per search once an exit is warm; warming a new exit costs 30-110 MB
64
- - 1.4 seconds per search on a warm exit (median)
68
+ </div>
65
69
 
66
70
  Scrape Google search results (SERP) with a real Chrome browser and your own
67
71
  residential proxy, and get clean JSON back. Use it as a CLI, a Python library,
68
72
  a local HTTP API, or an MCP server that gives AI agents live Google search.
69
73
 
70
- Plain HTTP is no longer a reliable way to scrape Google: it often expects a
71
- browser that runs JavaScript, and a fresh browser on a fresh proxy exit can be
72
- refused quickly. This tool takes a browser path instead. It warms a sticky proxy
73
- session with ordinary browsing, opens Google's results page for each query in
74
- that browser, checks whether Google served results or refused, and writes one
75
- JSON record per results page. Captchas, blocks and failures are reported as
76
- such, never as "no results".
77
-
78
- Once Google serves the browser, most results pages come over direct HTTPS
79
- requests with the browser's own cookies and request headers, and the browser
80
- runs only when Google asks for its check again or a request does not bring a
81
- usable page. A results page fetched that way is a single
82
- document instead of a fully rendered page, so it costs a fraction of the
83
- traffic.
74
+ Plain HTTP is no longer a reliable way to scrape Google, and a fresh browser on a
75
+ fresh proxy IP is refused quickly. So the scraper warms a sticky proxy session
76
+ with ordinary browsing, lets the browser pass Google's checks, and then fetches
77
+ results pages directly over HTTPS with the browser's own cookies. Captchas and
78
+ blocks are reported as such, never as "no results".
84
79
 
85
80
  ## Features
86
81
 
87
- - **Real browser scraping:** real Chrome via Patchright, with a warm-up before every new identity
88
- - **Low traffic:** results pages over HTTP with the browser's cookies between Google's checks; the browser takes over by itself when that stops working
89
- - **Bring your own proxy:** any residential proxy with sticky sessions, built-in [NodeMaven](https://nodemaven.com/?utm_source=github&utm_medium=readme&utm_campaign=google_browser_scraper&utm_content=features) support
90
- - **SERP API alternative:** JSON with `organic_results`, `ads`, `related_questions`, `related_searches`, `pagination`, `ai_overview` and `local_results`
91
- - **Honest failures:** captchas and blocks come back labeled, not as empty results; an exit that keeps getting results unrelated to the queries is dropped
92
- - **Cost tracking:** bytes per page and cost per 1000 pages in every run summary
93
- - **Four ways to run it:** CLI, Python library, HTTP API, MCP server for AI agents
94
- - **Docker image** for self-hosted deployment
82
+ <table>
83
+ <tr>
84
+ <td width="50%" valign="top">
85
+
86
+ ⚡ **Hybrid mode**<br>
87
+ Results pages over HTTPS between Google's checks: a fraction of a browser's traffic and time. The browser takes over by itself when needed.
88
+
89
+ </td>
90
+ <td width="50%" valign="top">
91
+
92
+ 🛡️ **Poisoned results protection**<br>
93
+ Pages of results for some other query are caught: the proxy IP serving them is dropped within a few pages and the query is asked again on a fresh one.
94
+
95
+ </td>
96
+ </tr>
97
+ <tr>
98
+ <td valign="top">
99
+
100
+ 🌐 **Real browser**<br>
101
+ Real Chrome via Patchright, warmed up before every new identity, so Google's checks pass.
102
+
103
+ </td>
104
+ <td valign="top">
105
+
106
+ 🧩 **SERP API-style JSON**<br>
107
+ `organic_results`, `ads`, `related_questions`, `related_searches`, `pagination`, `ai_overview`, `local_results`.
108
+
109
+ </td>
110
+ </tr>
111
+ <tr>
112
+ <td valign="top">
113
+
114
+ 🔌 **Bring your own proxy**<br>
115
+ Any residential proxy with sticky sessions, built-in [NodeMaven](https://nodemaven.com/?utm_source=github&utm_medium=readme&utm_campaign=google_browser_scraper&utm_content=features) support.
116
+
117
+ </td>
118
+ <td valign="top">
119
+
120
+ 🚦 **Honest failures**<br>
121
+ Captchas and blocks come back labeled, not as empty results.
122
+
123
+ </td>
124
+ </tr>
125
+ <tr>
126
+ <td valign="top">
127
+
128
+ 🤖 **For AI agents**<br>
129
+ An MCP server that gives agents live Google search, with the AI Overview and map places.
130
+
131
+ </td>
132
+ <td valign="top">
133
+
134
+ 🐳 **Run it your way**<br>
135
+ CLI, Python library, HTTP API, MCP server or Docker image. Traffic and cost per 1000 pages in every run summary.
136
+
137
+ </td>
138
+ </tr>
139
+ </table>
95
140
 
96
141
  ## Use cases
97
142
 
@@ -109,8 +154,9 @@ patchright install chromium
109
154
 
110
155
  ## Quickstart
111
156
 
112
- You need a residential proxy with **sticky sessions**. Put `{session}` where
113
- your provider expects a session id in the username:
157
+ > [!NOTE]
158
+ > You need a residential proxy with **sticky sessions**. Put `{session}` where
159
+ > your provider expects a session id in the username.
114
160
 
115
161
  ```bash
116
162
  google-browser-scraper search "best running shoes" \
@@ -118,13 +164,13 @@ google-browser-scraper search "best running shoes" \
118
164
  -o results.jsonl
119
165
  ```
120
166
 
121
- The first query takes a few minutes, because a new exit is warmed up first, and
122
- the warm-up costs noticeably more traffic than a search. Later queries on the
123
- same exit take seconds. A summary of pages served and traffic used, with the
124
- hosts that took most of it, is printed at the end of every run.
167
+ The first query takes a few minutes while a new proxy IP warms up; later queries on
168
+ the same proxy IP take seconds. Every run ends with a summary of pages served and
169
+ traffic used.
170
+
171
+ ### With NodeMaven
125
172
 
126
- With [NodeMaven](https://nodemaven.com/?utm_source=github&utm_medium=readme&utm_campaign=google_browser_scraper&utm_content=proxy_setup) residential proxies, the
127
- session id is handled for you and the credentials come from the environment:
173
+ The session id is handled for you and the credentials come from the environment:
128
174
 
129
175
  ```bash
130
176
  pip install "google-browser-scraper[nodemaven]"
@@ -135,27 +181,39 @@ google-browser-scraper search -f queries.txt --nodemaven --country us -o results
135
181
  > [!TIP]
136
182
  > 🎁 **2 GB of free traffic.** No NodeMaven account yet? [Sign up](https://dashboard.nodemaven.com/accounts/signup/?utm_source=github&utm_medium=readme&utm_campaign=google_browser_scraper&utm_content=signup_promo) and enter the code **GOOGLENM**. Once per account.
137
183
 
138
- To cap a run's traffic, `--nodemaven-demo` creates a sub-user with a traffic limit
139
- from your dashboard API key, shares it across workers, and deletes it when the run
140
- ends (`--keep-subuser` keeps it). The account needs sub-users enabled. A fresh
141
- warm-up alone uses about 60 MB, so keep the cap well above that:
184
+ <details>
185
+ <summary><b>Cap a run's traffic with a demo sub-user</b></summary>
186
+
187
+ <br>
188
+
189
+ `--nodemaven-demo` creates a sub-user with a traffic limit from your dashboard API
190
+ key, shares it across workers, and deletes it when the run ends (`--keep-subuser`
191
+ keeps it). The account needs sub-users enabled. A fresh warm-up alone uses about
192
+ 60 MB, so keep the cap well above that:
142
193
 
143
194
  ```bash
144
195
  export NODEMAVEN_API_KEY=...
145
196
  google-browser-scraper search -f queries.txt --nodemaven-demo --traffic-limit-mb 300 -o results.jsonl
146
197
  ```
147
198
 
148
- To try it without a proxy, use your own connection:
199
+ </details>
200
+
201
+ <details>
202
+ <summary><b>Try it without a proxy</b></summary>
203
+
204
+ <br>
149
205
 
150
206
  ```bash
151
207
  google-browser-scraper search "best running shoes" --no-proxy
152
208
  ```
153
209
 
154
210
  Google then sees one address for every query, so it starts answering with
155
- captchas sooner than it would across a pool of exits. Those pages come back as
211
+ captchas sooner than it would across a pool of proxy IPs. Those pages come back as
156
212
  `captcha` in `page_verdict`, not as empty results.
157
213
 
158
- From Python:
214
+ </details>
215
+
216
+ ### From Python
159
217
 
160
218
  ```python
161
219
  from google_browser_scraper import ProxyTemplate, Scraper, Settings
@@ -172,34 +230,51 @@ One JSON object per results page:
172
230
 
173
231
  ```json
174
232
  {
175
- "search_metadata": {"status": "Success", "page_verdict": "ok"},
233
+ "search_metadata": {"status": "Success", "page_verdict": "ok", "fetched_with": "http"},
176
234
  "search_parameters": {"engine": "google", "q": "best running shoes", "page": 1},
177
235
  "organic_results": [
178
236
  {"position": 1, "title": "...", "link": "https://...", "snippet": "..."}
179
237
  ],
180
238
  "related_questions": [{"question": "..."}],
239
+ "ai_overview": {"text": "..."},
181
240
  "exit": {"session": "...", "queries_on_exit": 1, "bytes": "..."}
182
241
  }
183
242
  ```
184
243
 
185
- The schema uses the field names common to SERP APIs: `organic_results`, `ads`,
186
- `related_questions`, `related_searches`, `pagination` and `search_metadata`, so
187
- simple consumers can often switch with minimal mapping. `ai_overview` holds the
188
- text of Google's AI Overview when the page shows one, and `local_results` the
189
- places of the map pack on local queries (name, rating, reviews, type, address,
190
- phone, opening hours). The AI Overview is found by its English heading, so it is read
191
- on pages in English (`--hl en`, the default).
244
+ The field names are the ones common to SERP APIs, so simple consumers can often
245
+ switch with minimal mapping.
246
+
247
+ <details>
248
+ <summary><b>All fields</b></summary>
249
+
250
+ <br>
251
+
252
+ - `organic_results`, `ads`, `related_questions`, `related_searches`, `pagination`, `search_metadata`
253
+ - `ai_overview`: the text of Google's AI Overview when the page shows one (pages in English, `--hl en`, the default)
254
+ - `local_results`: the places of the map pack on local queries (name, rating, reviews, type, address, phone, opening hours)
255
+ - `exit`: which proxy IP (sticky session) answered and how many bytes the page cost
256
+ - `search_metadata.fetched_with`: `http` or `browser`
257
+ - `search_metadata.timings`: seconds per step (`http` for a page fetched over HTTP; `type`, `load`, `ready` and `read` for one the browser rendered; `parse`; `links`, which overlaps the next query)
258
+ - A query that failed is a record too, with an `error`
259
+
192
260
  Knowledge panels, shopping, images and other special blocks are not parsed.
261
+ `--format csv` writes the organic results as a table, and `--price-per-gb` adds
262
+ the cost per 1000 pages to the summary.
263
+
264
+ </details>
193
265
 
194
- Each record also has an `exit` block: which proxy session answered and how many
195
- bytes the page cost. `search_metadata.fetched_with` is `http` or `browser`.
196
- `search_metadata.timings` says where the page's time went, in seconds per step
197
- (`http` for a page fetched over HTTP; `type`, `load`, `ready` and `read` for one
198
- the browser rendered; `parse`; and `links`, which overlaps the next query and is
199
- not part of `total_time_taken`). A query that
200
- failed is a record too, with an `error`. `--format csv` writes the organic
201
- results as a table, and `--price-per-gb` adds the cost per 1000 pages to the
202
- summary.
266
+ ## Poisoned results protection
267
+
268
+ Google does not always block a scraper. Sometimes it answers with a normal-looking
269
+ results page for a different query: no captcha, no error, just wrong data that
270
+ slips into your pipeline unnoticed.
271
+
272
+ The scraper checks results pages against the queries it asked. When a proxy IP
273
+ starts returning unrelated results, it is dropped within a few pages and the query
274
+ is asked again on a fresh one.
275
+
276
+ - No extra requests, no extra traffic: the check runs on the page already downloaded
277
+ - On by default
203
278
 
204
279
  ## Run it as an API
205
280
 
@@ -208,14 +283,11 @@ google-browser-scraper serve --nodemaven --country us --prewarm
208
283
  curl "http://127.0.0.1:8000/search.json?q=best+running+shoes"
209
284
  ```
210
285
 
211
- Same record format as above. `hl` (language, e.g. `de`) and `gl` (country,
212
- e.g. `at`) can be set per request: `/search.json?q=...&hl=de&gl=at`. Requests
213
- run one at a time on one held identity.
214
- `--prewarm` searches once at startup, moving to a new exit until Google serves
215
- one, so a request sent after it does not wait for a warm-up. `/health` answers
216
- 503 `warming` until then; a request sent earlier waits in line behind it. Set
217
- `GBS_API_KEY` to require a key; without one the server only listens on
218
- localhost.
286
+ - Same record format as above
287
+ - `hl` (language) and `gl` (country) per request: `/search.json?q=...&hl=de&gl=at`
288
+ - `--prewarm` finds a proxy IP Google serves at startup, so the first request does not wait for a warm-up; `/health` answers 503 `warming` until then
289
+ - Requests run one at a time on one held proxy IP
290
+ - Set `GBS_API_KEY` to require a key; without one the server only listens on localhost
219
291
 
220
292
  ## Use it from an AI agent (MCP)
221
293
 
@@ -231,9 +303,9 @@ localhost.
231
303
  }
232
304
  ```
233
305
 
234
- It exposes one tool, `google_search(query, pages, hl, gl)`. The answer carries
235
- the organic results, "People also ask", related searches, and the AI Overview and
236
- map places when Google shows them.
306
+ One tool, `google_search(query, pages, hl, gl)`. It returns the organic results,
307
+ "People also ask", related searches, and the AI Overview and map places when
308
+ Google shows them.
237
309
 
238
310
  ## Docker
239
311
 
@@ -252,62 +324,54 @@ To build it yourself: `docker build -t google-browser-scraper .`
252
324
 
253
325
  1. **New identity:** a sticky proxy session and a fresh browser profile.
254
326
  2. **Warm-up:** a few ordinary pages, staying on each for 20-45 seconds.
255
- 3. **Search:** an exit's first query opens Google's results page in the
256
- browser. Once Google serves it, the following results pages are fetched
257
- over HTTP with the browser's cookies and headers, until Google asks for its
258
- check again; the browser then runs one query, passes it, and HTTP carries on
259
- with the fresh cookies.
260
- 4. **Check before parsing:** the page is classified first, so a captcha or a
261
- block is reported as one and never parsed as an empty result.
262
- 5. **Keep or drop:** an exit Google answers is reused for the next queries; an
263
- exit it refuses is dropped and the query is retried on a new one. If exit
264
- after exit is refused, the run stops instead of spending more traffic.
327
+ 3. **Search:** the first query on a proxy IP goes through the browser. Once Google
328
+ serves it, the next pages come over HTTPS with the browser's cookies, until
329
+ Google asks for its check again.
330
+ 4. **Check before parsing:** a captcha or a block is reported as one, never
331
+ parsed as an empty result.
332
+ 5. **Keep or drop:** a proxy IP Google answers is reused; one it refuses is dropped
333
+ and the query retried on a new one. If one proxy IP after another is refused, the run
334
+ stops instead of spending more traffic.
265
335
 
266
336
  <details>
267
- <summary><b>More detail: HTTP between checks, holding exits, copied cookies, result links, traffic</b></summary>
337
+ <summary><b>More detail: HTTP between checks, holding proxy IPs, copied cookies, result links, traffic</b></summary>
268
338
 
269
339
  <br>
270
340
 
271
- **HTTP between checks.** The request headers come from Chromium itself: once per
272
- run, the first served browser search is recorded in a Chromium NetLog and its
273
- headers are reused in Chromium's order, through `curl_cffi` with Chrome's TLS and
274
- HTTP/2 fingerprint, on the same exit and the same counting relay. When the HTTP
275
- side stops getting pages (several short runs between checks in a row, errors, or
276
- pages that parse to nothing, which is what a change in Google's markup looks
277
- like), that exit goes back to the browser; when several exits in a row do, the
278
- whole run does. `--no-hybrid` uses the browser for every page.
279
-
280
- **Unrelated results.** Google is reported to answer some automated traffic with
281
- a normal-looking page of results for other queries instead of a block. When three
282
- pages in a row on one exit have almost no title that carries the query's words,
283
- the exit is dropped and the query asked again on a new one. One-word queries are
284
- not judged.
285
-
286
- **Holding exits.** A served exit is kept for up to 300 queries. Every new exit
341
+ **HTTP between checks.** After the browser passes Google's check, results pages
342
+ are fetched over HTTPS with the browser's own headers and cookies. If that stops
343
+ working, the scraper goes back to the browser on its own. `--no-hybrid` uses the
344
+ browser for every page.
345
+
346
+ **Unrelated results.** A proxy IP that starts returning results unrelated to the
347
+ queries is dropped, and the query is asked again on a new one.
348
+
349
+ **Holding proxy IPs.** A served proxy IP is kept for up to 300 queries. Every new one
287
350
  pays for a warm-up, so a short cap mostly buys more warm-up traffic. Every 50
288
- results pages it renders, the browser is restarted on the same profile and exit, which keeps
351
+ results pages it renders, the browser is restarted on the same profile and proxy IP, which keeps
289
352
  its memory from growing over a long hold. A browser error on a search is retried
290
- once on the same exit before the exit is dropped; a network error, running out of
353
+ once on the same proxy IP before it is dropped; a network error, running out of
291
354
  memory or a crashed browser drops it at once.
292
355
 
293
- **Copying cookies.** The command line copies the cookies of the first exit
294
- Google serves and starts new exits from that copy, on new sticky sessions,
356
+ **Copying cookies.** The command line copies the cookies of the first proxy IP
357
+ Google serves and starts new proxy IPs from that copy, on new sticky sessions,
295
358
  instead of warming each one; all workers share the copy. Google's acceptance
296
359
  follows the cookies more than the address, so a copy usually starts out served
297
360
  and costs a few MB instead of a full warm-up. A copy waits 40-60 seconds after
298
361
  its browser starts before the first search.
299
362
 
300
- **Copying the cache.** Pages get cheaper as an exit is held, because the
363
+ **Copying the cache.** Pages get cheaper as a proxy IP is held, because the
301
364
  browser cache fills with Google's shared scripts and images. Copies carry that
302
- cache too, so a new exit starts with cheap pages, and the copy is refreshed
303
- from the held exit at each browser restart, when its cache is warm. If two
365
+ cache too, so a new proxy IP starts with cheap pages, and the copy is refreshed
366
+ from the held one at each browser restart, when its cache is warm. If two
304
367
  copies carrying the cache are refused on their first search, the rest of the
305
368
  run copies cookies only (`--no-clone-cache` does that from the start).
306
369
 
307
370
  **Result links.** Google wraps result links in encrypted `/goto` redirects.
308
- Each one is resolved with a small request through a separate short-lived proxy
309
- session, a few at a time, in the background while the browser goes on to the
310
- next query. Records still come out in the order each browser searched them.
371
+ Each one is resolved with a small request on the proxy IP the page came from,
372
+ with that page's cookies, in the background while the next query runs; a link
373
+ left over is tried through a separate short-lived proxy session. Records still
374
+ come out in the order each browser searched them.
311
375
 
312
376
  **Traffic.** Everything goes through a small local relay that counts bytes per
313
377
  host and blocks a large model download Chrome otherwise makes on every fresh
@@ -327,20 +391,20 @@ The defaults come from measurements in
327
391
 
328
392
  | Option | Default | What it does |
329
393
  |---|---|---|
330
- | `--workers N` | 1 | Search on N exits at once, one browser each, from one list of queries |
331
- | `--max-per-exit N` | 300 | Queries before a served exit is retired |
332
- | `--restart-every N` | 50 | Results pages the browser rendered before it restarts on the same profile and exit; `0` never |
394
+ | `--workers N` | 1 | Search on N proxy IPs at once, one browser each, from one list of queries |
395
+ | `--max-per-exit N` | 300 | Queries before a served proxy IP is retired |
396
+ | `--restart-every N` | 50 | Results pages the browser rendered before it restarts on the same profile and proxy IP; `0` never |
333
397
  | `--no-hybrid` | | Fetch every results page in the browser instead of over HTTP between Google's checks |
334
398
  | `--hl`, `--gl` | `en`, unset | Language and country of the results |
335
- | `--clone N` | 10 | New exits started from copied cookies; `0` turns copying off |
399
+ | `--clone N` | 10 | New proxy IPs started from copied cookies; `0` turns copying off |
336
400
  | `--clone-max-age` | 180 | Minutes copied cookies stay in use |
337
401
  | `--clone-refusals N` | 1 | Copies refused in a row on their first query that end the copying |
338
402
  | `--no-clone-cache` | | Copies carry cookies only, not the browser cache |
339
- | `--warmup` | `L3` | Pages a fresh exit opens before its first query: `L3`, `light` (without Google Trends: much less traffic, served on the first query less often), `L2`, `L1`, `off` |
340
- | `--spare N` | 0 | Exits warmed in the background so a retired one is replaced at once; each costs a warm-up |
341
- | `--direct` | `all` | Open results pages directly: `all`, `follow-ups` (all but an exit's first query), `none` |
403
+ | `--warmup` | `L3` | Pages a fresh proxy IP opens before its first query: `L3`, `light` (without Google Trends: much less traffic, served on the first query less often), `L2`, `L1`, `off` |
404
+ | `--spare N` | 0 | Proxy IPs warmed in the background so a retired one is replaced at once; each costs a warm-up |
405
+ | `--direct` | `all` | Open results pages directly: `all`, `follow-ups` (all but the first query on each proxy IP), `none` |
342
406
  | `--input` | `type` | How a query goes into the search box: `type`, `insert`, `words` |
343
- | `--gap LOW,HIGH` | 2,5 | Seconds between queries on one exit |
407
+ | `--gap LOW,HIGH` | 2,5 | Seconds between queries on one proxy IP |
344
408
  | `--pages N` | 1 | Result pages per query |
345
409
  | `--format` | `jsonl` | `jsonl` or `csv` |
346
410
  | `--price-per-gb` | | Your proxy price, to print the cost per 1000 pages |
@@ -354,7 +418,7 @@ The defaults come from measurements in
354
418
  ## Proxies
355
419
 
356
420
  Any provider with sticky sessions works through `--proxy` and a `{session}`
357
- placeholder. A proxy without one is accepted with a warning: if the exit changes
421
+ placeholder. A proxy without one is accepted with a warning: if the proxy IP changes
358
422
  on every request, warming it does nothing. SOCKS5 needs an IP-whitelisted
359
423
  endpoint, because Chrome cannot send a SOCKS5 username and password.
360
424
 
@@ -370,8 +434,8 @@ size. Google answers some machines much less than others, so run this first.
370
434
 
371
435
  ## What this is not
372
436
 
373
- Not a free Google Search API, and not a guarantee that every proxy exit will
374
- work. It is a browser-based collector that makes failures explicit, drops exits
437
+ Not a free Google Search API, and not a guarantee that every proxy IP will
438
+ work. It is a browser-based collector that makes failures explicit, drops proxy IPs
375
439
  Google refuses, and tells you what each page cost.
376
440
 
377
441
  ## Status