PlaywrightBrowserPlugin
Hierarchy
- BaseBrowserPlugin
- PlaywrightBrowserPlugin
Index
Methods
__aenter__
Enter the context manager and initialize the browser plugin.
Returns BaseBrowserPlugin
__aexit__
Exit the context manager and close the browser plugin.
Parameters
optionalkeyword-onlyexc_type: type[BaseException] | None
optionalkeyword-onlyexc_value: BaseException | None
optionalkeyword-onlyexc_traceback: TracebackType | None
Returns None
__init__
A default constructor.
Parameters
optionalkeyword-onlybrowser_type: BrowserType = 'chromium'
The type of browser to launch ('chromium', 'firefox', or 'webkit').
optionalkeyword-onlybrowser_options: Mapping[str, Any] | None = None
Keyword arguments to pass to the browser launch method. These options are provided directly to Playwright's
browser_type.launch
method. For more details, refer to the Playwrightoptionalkeyword-onlypage_options: Mapping[str, Any] | None = None
Keyword arguments to pass to the new page method. These options are provided directly to Playwright's
browser_context.new_page
method. For more details, refer to the Playwright documentation: https://playwright.dev/python/docs/api/class-browsercontext#browser-context-new-page.optionalkeyword-onlymax_open_pages_per_browser: int = 20
The maximum number of pages that can be opened in a single browser instance. Once reached, a new browser instance will be launched to handle the excess.
Returns None
new_browser
Create a new browser instance.
Returns BaseBrowserController
Properties
active
Indicates whether the context is active.
AUTOMATION_LIBRARY
The name of the automation library that the plugin is managing.
browser_options
Return the options for a new browser.
browser_type
Return the browser type name.
max_open_pages_per_browser
Return the maximum number of pages that can be opened in a single browser.
page_options
Return the options for a new page.
A plugin for managing Playwright automation library.
It should work as a factory for creating new browser instances.