Expand description
Configuration types for browser automation sessions.
This module contains every knob you can turn when launching a browser through
scrapling-browser. The primary entry point is BrowserConfig, which controls
how the browser is launched, how pages are navigated, and what requests are
blocked. For anti-detection scenarios, StealthConfig wraps a BrowserConfig
and adds stealth-specific options such as canvas noise and WebRTC blocking.
Most fields on BrowserConfig have sensible defaults (see the Default impl),
so you typically only override the two or three settings you care about:
use scrapling_browser::BrowserConfig;
let config = BrowserConfig {
headless: true,
disable_resources: true,
block_ads: true,
..Default::default()
};When you need to tweak behaviour on a per-request basis without rebuilding the
entire config, create a FetchParams with only the fields you want to override.
The session’s fetch method merges those overrides with the base config into a
ResolvedFetchParams struct that carries the final, concrete values used for
that single navigation.
§Key types
| Type | Purpose |
|---|---|
BrowserConfig | Session-level browser settings (headless, proxy, timeouts, etc.) |
StealthConfig | Anti-detection wrapper around BrowserConfig |
FetchParams | Optional per-request overrides |
ResolvedFetchParams | Fully resolved values after merging FetchParams + BrowserConfig |
ProxyConfig | Static proxy server credentials |
CookieParam | A cookie to inject before navigation |
WaitState | Required DOM state of a wait selector |
PageCallback | Async closure invoked on a page at setup or post-navigation |
StealthContextOptions | Viewport / device emulation values for stealth mode |
Structs§
- Browser
Config - Browser session configuration – the central struct that controls how the Playwright browser is launched and how pages are navigated.
- Cookie
Param - A cookie to inject into the browser context before navigation.
- Fetch
Params - Per-fetch parameter overrides – a subset of
BrowserConfigthat can be changed on a per-request basis. - Proxy
Config - Static proxy server connection parameters.
- Resolved
Fetch Params - Fully resolved fetch parameters produced by merging
FetchParamswithBrowserConfig. - Stealth
Config - Stealth browser configuration – extends
BrowserConfigwith anti-detection options. - Stealth
Context Options - Browser-context options tuned for stealth emulation.
Enums§
- Wait
State - Required DOM state of a selector before the wait is satisfied.
Type Aliases§
- Page
Callback - Async callback that receives a Playwright page reference.