ddp_utils.browser.backends.selenium.launcher¶
import ddp_utils.browser.backends.selenium.launcher
Lazy Selenium and SeleniumBase browser construction.
- class ddp_utils.browser.backends.selenium.launcher.SeleniumBrowserLauncher(*, webdriver_module: Any | None = None, seleniumbase_constructor: Callable[[...], Any] | None = None)¶
Bases:
objectConstruct WebDriver sessions without import-time optional dependencies.
Parameters
Name
Type
Description
webdriver_module
Any | None
Optional injected
selenium.webdrivermodule.seleniumbase_constructor
Callable[..., Any] | None
Optional injected SeleniumBase
Driver.Examples
Use lazy imports in production:
launcher = SeleniumBrowserLauncher()
Store optional injectable constructors without opening a browser.
Parameters
Name
Type
Description
webdriver_module
Any | None
Optional injected
selenium.webdrivermodule.seleniumbase_constructor
Callable[..., Any] | None
Optional injected SeleniumBase
Driver.Examples
Inject fakes for deterministic unit tests:
launcher = SeleniumBrowserLauncher(webdriver_module=fake_webdriver)
- launch(config: BrowserConfig, options: SeleniumLaunchOptions) SeleniumNativeObjects¶
Launch the resolved Selenium provider.
Parameters
Name
Type
Description
config
Validated Selenium browser configuration.
options
Normalized provider launch options.
Returns
Type
Description
Explicit native WebDriver and optional SeleniumBase objects.
Raises
Exception
Description
The selected combination cannot be implemented without silently ignoring configuration.
Dependencies are missing or startup fails.
Examples
Launch after backend validation:
native = launcher.launch(config, options)