Skip to content

The headless browser for AI agents and web scraping

docs: update guides for global --stealth, --dump cookies, fetch assets

SGavrl4e500a2aadbd
diff --git a/docs/Architecture-overview.md b/docs/Architecture-overview.md
index 05b1e647..f0e835c5 100644
--- a/docs/Architecture-overview.md
+++ b/docs/Architecture-overview.md
@@ -101,7 +101,7 @@ init → commit → domcontentloaded → load → networkidle2 → networkidle0
## Stealth
-`--stealth` swaps the default `reqwest` client for `obscura-net/wreq_client.rs`, which randomizes TLS ClientHello and cipher order to match a real browser, and applies the bundled tracker blocklist before any request leaves the process.
+`--stealth` swaps the default `reqwest` client for `obscura-net/wreq_client.rs`, which presents a real browser's TLS ClientHello, ALPN, and cipher order (a consistent Chrome fingerprint, not a randomized one) so the TLS layer matches the User-Agent and JS surfaces. It also applies the bundled tracker blocklist before any request leaves the process. Scripted `fetch()`/XHR go through the same stealth client, so subresource requests carry the same fingerprint as the navigation. `--stealth` is a global CLI flag that applies to `fetch`, `serve`, `scrape`, and `mcp`.
## Workspace conventions
diff --git a/docs/CLI-reference.md b/docs/CLI-reference.md
index fee7a510..c7c45413 100644
--- a/docs/CLI-reference.md
+++ b/docs/CLI-reference.md
@@ -6,6 +6,7 @@ Top-level flags apply to every subcommand.
-v, --verbose Enable info logging
-p, --port <PORT> CDP port (default 9222)
--proxy <URL> HTTP or SOCKS5 proxy
+ --stealth Consistent browser fingerprint + tracker blocking
--obey-robots Respect robots.txt
--user-agent <UA> Override the User-Agent
--storage-dir <DIR> Persistent cookies and localStorage
@@ -20,7 +21,7 @@ Top-level flags apply to every subcommand.
Load a URL and print its content or an evaluated expression.
```
- --dump <FORMAT> html | text | links | markdown | original | assets
+ --dump <FORMAT> html | text | links | markdown | original | assets | cookies
(default html)
--selector <CSS> Narrow output to a CSS selector
--wait <SECONDS> Extra wait after settle (default 5)
@@ -29,7 +30,7 @@ Load a URL and print its content or an evaluated expression.
(default load)
--user-agent <UA> Override the User-Agent
--proxy <URL> HTTP or SOCKS5 proxy
- --stealth TLS fingerprint randomization + tracker blocking
+ --stealth Consistent browser fingerprint + tracker blocking (global)
-e, --eval <JS> Evaluate JS, print the result as JSON
-o, --output <FILE> Write to a file instead of stdout
-q, --quiet Suppress info logging
@@ -44,8 +45,9 @@ Load a URL and print its content or an evaluated expression.
| `text` | Plain text |
| `markdown` | Markdown conversion |
| `links` | Every `<a href>`, one URL per line |
-| `assets` | Every external resource, one JSON object per line |
+| `assets` | Every external resource, one JSON object per line (DOM assets plus `fetch()`/XHR requests) |
| `original` | Raw HTTP response body (binary-safe, bypasses the engine) |
+| `cookies` | All cookies in the jar as a JSON array, including HttpOnly cookies invisible to `document.cookie` |
## `obscura serve`
@@ -56,7 +58,7 @@ Run the CDP server. Puppeteer and Playwright connect over WebSocket.
--host <HOST> Bind host (default 127.0.0.1)
--proxy <URL> HTTP or SOCKS5 proxy
--user-agent <UA> Override the User-Agent
- --stealth TLS fingerprint randomization + tracker blocking
+ --stealth Consistent browser fingerprint + tracker blocking (global)
--workers <N> Worker processes (default 1)
--allow-file-access Permit CDP clients to navigate to file:// URLs
--storage-dir <DIR> Persistent cookies and localStorage
@@ -77,11 +79,14 @@ Run a JS expression across many URLs in parallel.
--format <FORMAT> Output format (default json)
--timeout <SECONDS> Per-URL timeout (default 60)
--proxy <URL> HTTP or SOCKS5 proxy
+ --stealth Consistent browser fingerprint + tracker blocking (global)
--allow-private-network Permit loopback / RFC1918 / link-local
-q, --quiet Suppress info logging
-v, --verbose Enable verbose logging
```
+`--stealth`, `--proxy`, and `--allow-private-network` are global flags: they work before or after any subcommand, so each worker in a `scrape` run inherits stealth too.
+
Read URLs from stdin with `-`:
```bash
@@ -100,7 +105,7 @@ Run obscura as an MCP server.
--port <PORT> HTTP port (default 3000)
--proxy <URL> HTTP or SOCKS5 proxy
--user-agent <UA> Override the User-Agent
- --stealth TLS fingerprint randomization + tracker blocking
+ --stealth Consistent browser fingerprint + tracker blocking (global)
--allow-private-network Permit loopback / RFC1918 / link-local
-v, --verbose Enable info logging
```
diff --git a/docs/Configure-stealth-and-proxies.md b/docs/Configure-stealth-and-proxies.md
index e3b3e074..26a08aed 100644
--- a/docs/Configure-stealth-and-proxies.md
+++ b/docs/Configure-stealth-and-proxies.md
@@ -3,9 +3,12 @@
```bash
obscura fetch https://example.com --stealth
obscura serve --stealth
+obscura scrape url1 url2 --stealth
obscura mcp --stealth
```
+`--stealth` is a global flag, so it works before or after the subcommand and applies to `fetch`, `serve`, `scrape`, and `mcp`. In a `scrape` run each worker inherits it.
+
What `--stealth` changes:
- Uses the wreq HTTP client with browser-matching TLS fingerprints (ClientHello, ALPN, cipher order).
diff --git a/docs/Extract-data.md b/docs/Extract-data.md
index c37632b8..501a52b2 100644
--- a/docs/Extract-data.md
+++ b/docs/Extract-data.md
@@ -7,6 +7,7 @@ obscura fetch https://example.com --dump markdown
obscura fetch https://example.com --dump links
obscura fetch https://example.com --dump assets
obscura fetch https://example.com --dump original
+obscura fetch https://example.com --dump cookies
```
## `html`
@@ -43,7 +44,7 @@ obscura fetch https://example.com --dump links
## `assets`
-Every external resource (stylesheets, scripts, images, fonts, iframes), one per line.
+Every external resource (stylesheets, scripts, images, fonts, iframes), plus the URLs the page requested through `fetch()`/XHR, one JSON object per line.
```bash
obscura fetch https://example.com --dump assets
@@ -59,6 +60,14 @@ obscura fetch https://my-spa.example --dump html > after.html
diff before.html after.html
```
+## `cookies`
+
+Every cookie in the jar as a JSON array, including HttpOnly cookies that `document.cookie` cannot see. Useful for capturing session tokens set by anti-bot challenges.
+
+```bash
+obscura fetch https://example.com --dump cookies
+```
+
## With `--wait-until`
`--dump` runs after the wait condition: