Chrome
Manages a headless Chrome browser process.
Usage
Chrome()Launches Chrome with remote debugging enabled and provides the WebSocket URL for CDP communication.
Parameters
path: str | None = None-
Path to Chrome executable. If None, auto-detected via find_chrome().
headless: bool = True-
Whether to run in headless mode.
extra_args: list[str] | None = None-
Additional command-line arguments to pass to Chrome.
timeout: float = 20.0- Maximum seconds to wait for Chrome to start and report its WS URL.
Attributes
| Name | Description |
|---|---|
| pid | The Chrome process ID, or None if not running. |
| port | The remote debugging port. |
| ws_url | The WebSocket URL for CDP communication. |
pid
The Chrome process ID, or None if not running.
pid: int | None
port
The remote debugging port.
port: int
ws_url
The WebSocket URL for CDP communication.
ws_url: str
Methods
| Name | Description |
|---|---|
| close() | Terminate the Chrome process. |
| is_alive() | Check if the Chrome process is still running. |
close()
Terminate the Chrome process.
Usage
close()is_alive()
Check if the Chrome process is still running.
Usage
is_alive()