Skip to content

API Reference parrot_tools.scraping.drivers.playwright_config

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.scraping.drivers.playwright_config

View source

Playwright browser configuration dataclass.

Class PlaywrightConfig

Configuration for PlaywrightDriver.

Holds all browser, context, and page settings used to launch and configure Playwright browser instances.

Parameter Type Default Description
browser_type str 'chromium' Browser engine — "chromium", "firefox", or "webkit".
headless bool True Whether to run the browser in headless mode.
slow_mo int 0 Milliseconds to wait between each action (useful for debugging).
timeout int 30 Default timeout in seconds for navigation and waiting.
viewport Optional[Dict[str, int]] None Browser viewport dimensions, e.g. {"width": 1280, "height": 720}.
locale Optional[str] None Browser locale, e.g. "en-US".
timezone Optional[str] None Timezone ID, e.g. "America/New_York".
geolocation Optional[Dict[str, float]] None Geolocation coordinates, e.g. {"latitude": 40.7, "longitude": -74.0}.
permissions List[str] list() List of browser permissions to grant, e.g. ["geolocation"].
mobile bool False Whether to emulate a mobile device.
device_name Optional[str] None Playwright device descriptor name, e.g. "iPhone 13".
proxy Optional[Dict[str, str]] None Proxy settings, e.g. {"server": "http://proxy:8080"}.
ignore_https_errors bool False Whether to ignore HTTPS certificate errors.
extra_http_headers Optional[Dict[str, str]] None Additional HTTP headers for every request.
http_credentials Optional[Dict[str, str]] None HTTP authentication credentials, e.g. {"username": "u", "password": "p"}.
record_video_dir Optional[str] None Directory path to save screen recordings.
record_har_path Optional[str] None File path to record HAR network log.
storage_state Optional[str] None Path to a JSON file with saved cookies and localStorage for session reuse.
user_data_dir Optional[str] None Path to a persistent browser profile directory (e.g. a Google Chrome user-data dir). When set, the driver launches a persistent context over that profile, exposing its cookies, saved sessions and credential store.
channel Optional[str] None Browser distribution channel (e.g. "chrome", "msedge"). Required to open a real Google Chrome profile with its keyring-encrypted data; only meaningful for browser_type="chromium".
executable_path Optional[str] None Path to a browser executable to launch instead of the bundled engine or the channel's hardcoded install location (e.g. "/opt/google/chrome-beta/google-chrome-beta"). Takes precedence over channel for locating the binary.
engine str 'playwright' Connection engine — "playwright" (default) launches a local browser as before; "obscura" connects to a supervised Obscura CDP endpoint via chromium.connect_over_cdp() instead of launching a browser, preserving all other driver methods unchanged.
cdp_endpoint_url Optional[str] None Explicit CDP endpoint to connect to when engine="obscura", e.g. "http://127.0.0.1:9222". When unset, the endpoint is derived from obscura_port on 127.0.0.1.
obscura_binary Optional[str] None Path to (or PATH-resolvable name of) the Obscura binary. Not used by PlaywrightDriver itself — carried through for callers (e.g. the driver factory or CLI) that supervise the Obscura process via parrot.mcp.obscura.ObscuraProcessManager.
obscura_port int 9222 CDP port of the supervised Obscura process, used to derive cdp_endpoint_url when it is not set explicitly.
obscura_stealth bool False Obscura stealth-mode flag, carried through for process supervision callers; unused by this driver directly.
obscura_allow_private_network bool False Obscura --allow-private-network flag, carried through for process supervision callers; unused by this driver directly.

Fields:

Field Type Default Description
browser_type str 'chromium'
headless bool True
slow_mo int 0
timeout int 30
viewport Optional[Dict[str, int]] None
locale Optional[str] None
timezone Optional[str] None
geolocation Optional[Dict[str, float]] None
permissions List[str] field(default_factory=list)
mobile bool False
device_name Optional[str] None
proxy Optional[Dict[str, str]] None
ignore_https_errors bool False
extra_http_headers Optional[Dict[str, str]] None
http_credentials Optional[Dict[str, str]] None
record_video_dir Optional[str] None
record_har_path Optional[str] None
storage_state Optional[str] None
user_data_dir Optional[str] None
channel Optional[str] None
executable_path Optional[str] None
engine str 'playwright'
cdp_endpoint_url Optional[str] None
obscura_binary Optional[str] None
obscura_port int 9222
obscura_stealth bool False
obscura_allow_private_network bool False

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally