BrowserController
Hierarchy
- BrowserController
Index
Methods
close
Close the browser.
Parameters
optionalkeyword-onlyforce: bool = False
Whether to force close all open pages before closing the browser.
Returns None
new_page
Create a new page with the given context options.
Parameters
optionalbrowser_new_context_options: Mapping[str, Any] | None = None
Keyword arguments to pass to the browser new context method. These options are provided directly to Playwright's
browser.new_contextmethod. For more details, refer to the Playwright documentation: https://playwright.dev/python/docs/api/class-browser#browser-new-context.optionalproxy_info: ProxyInfo | None = None
The proxy configuration to use for the new page.
Returns Page
Page: The newly created page.
register_page_closed
Stop tracking the page as open.
Implementations must call it from the page's
closeevent. TheBrowserPoolalso calls it when closing the page never finishes, in which case that event never arrives, so it can be called more than once for the same page.Parameters
page: Page
The page that is no longer open.
Returns None
Properties
AUTOMATION_LIBRARY
The name of the automation library that the controller is using.
browser_type
Return the type of the browser.
has_free_capacity
Return if the browser has free capacity to open a new page.
idle_time
Return the idle time of the browser controller.
is_browser_connected
Return if the browser is closed.
is_opening_pages
Return if the browser has any new_page calls currently in flight.
last_page_opened_at
Return the time when the last page was opened.
pages
Return the list of opened pages.
pages_count
Return the number of currently open pages.
total_opened_pages
Return the total number of pages opened since the browser was launched.
An abstract base class for managing browser instance and their pages.