ddp_utils.browser.backends.selenium.models

import ddp_utils.browser.backends.selenium.models

Normalized launch options and native objects for Selenium providers.

class ddp_utils.browser.backends.selenium.models.SeleniumLaunchOptions(arguments: tuple[str, ...]=(), preferences: dict[str, ~typing.Any]=<factory>, capabilities: dict[str, ~typing.Any]=<factory>, binary_location: Path | None = None, proxy: str | None = None, locale: str | None = None, user_agent: str | None = None, page_load_strategy: str | None = None, accept_insecure_certs: bool = False, maximize: bool = True, initial_url: str | None = None, seleniumbase_kwargs: dict[str, ~typing.Any]=<factory>)

Bases: object

Provider-neutral Selenium launch options parsed from BrowserConfig.

Parameters

Name

Type

Description

arguments

tuple[str, ...]

Browser command-line arguments.

preferences

dict[str, Any]

Browser preference mapping.

capabilities

dict[str, Any]

WebDriver capability mapping.

binary_location

Path | None

Optional browser executable override.

proxy

str | None

Optional proxy URL or SeleniumBase proxy expression.

locale

str | None

Optional browser locale.

user_agent

str | None

Optional user-agent override.

page_load_strategy

str | None

Optional WebDriver page-load strategy.

accept_insecure_certs

bool

Accept invalid TLS certificates.

maximize

bool

Maximize the window after startup when visible.

initial_url

str | None

Optional first navigation URL.

seleniumbase_kwargs

dict[str, Any]

Explicit additional SeleniumBase Driver keywords.

Examples

Parse one managed-browser option set:

options = SeleniumLaunchOptions.from_mapping(
    {"locale": "en-US", "maximize": True}
)
classmethod from_mapping(values: Mapping[str, Any]) → SeleniumLaunchOptions

Parse and validate a backend option mapping.

Parameters

Name

Type

Description

values

Mapping[str, Any]

Selenium backend options from BrowserConfig.options.

Returns

Type

Description

SeleniumLaunchOptions

Normalized immutable launch options.

Raises

Exception

Description

BrowserConfigurationError

A key or value is unsupported.

Examples

Parse an authenticated proxy for SeleniumBase:

options = SeleniumLaunchOptions.from_mapping(
    {"proxy": "user:password@host:port"}
)
class ddp_utils.browser.backends.selenium.models.SeleniumNativeObjects(driver: Any, seleniumbase: Any | None = None)

Bases: object

Expose provider-native Selenium objects through one explicit escape hatch.

Parameters

Name

Type

Description

driver

Any

Active Selenium WebDriver-compatible object.

seleniumbase

Any | None

SeleniumBase driver object when that provider created the session; otherwise None.

Examples

Use WebDriver directly only where the neutral facade is insufficient:

driver = session.native.driver