botonomus.drivers¶
Driver adapters that attach page automation to a launched browser.
botonomus.drivers
¶
Driver adapters that attach page automation to a launched browser.
Attachment
¶
Driver
¶
Bases: Protocol
Factory for attachments; may hold a shared runtime (e.g. Playwright's).
start
async
¶
Start the driver runtime.
Raises:
| Type | Description |
|---|---|
BrowserStartupError
|
If the driver package is missing or fails to start. |
attach
async
¶
attach(port: int, timeout: float) -> Attachment
Connect to the browser listening on loopback port.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
port
|
int
|
The browser's |
required |
timeout
|
float
|
Seconds allowed for the connection. |
required |
NativeAttachment
¶
A native CDP connection to one browser.
Attributes:
| Name | Type | Description |
|---|---|---|
browser |
The connected |
|
context |
Any
|
The browser's default context. |
page |
Any
|
The initial page. |
NativeDriver
¶
Attaches NativeAttachment instances. Holds no shared runtime.
attach
async
¶
attach(port: int, timeout: float) -> NativeAttachment
Connect over the browser websocket advertised at /json/version.
PlaywrightAttachment
¶
A Playwright-compatible connection to one browser.
Attributes:
| Name | Type | Description |
|---|---|---|
browser |
The Playwright |
|
context |
Any
|
Its default |
page |
Any
|
The initial |
PlaywrightDriver
¶
Runs one Playwright (or Patchright) runtime shared by all attachments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flavor
|
PlaywrightFlavor
|
|
required |
start
async
¶
Start the runtime once.
Raises:
| Type | Description |
|---|---|
BrowserStartupError
|
If the package is not installed or fails to start. |
attach
async
¶
attach(port: int, timeout: float) -> PlaywrightAttachment
Connect with connect_over_cdp and return the default context's page.
create_driver
¶
create_driver(name: DriverName) -> Driver
Return the driver adapter for name.
Raises:
| Type | Description |
|---|---|
ConfigurationError
|
If |