Skip to main content

BaseBrowserController

crawlee.browsers._base_browser_controller.BaseBrowserController

An abstract class for managing browser instance and their pages.

Index

Methods

close

  • async close(*, force): None
  • Close the browser.


    Parameters

    • force: bool = Falsekeyword-only

    Returns None

new_page

  • async new_page(page_options, proxy_info): Page
  • Create a new page with the given context options.


    Parameters

    • page_options: Mapping[str, Any] | None = None
    • proxy_info: ProxyInfo | None = None

    Returns Page

    The newly created page.

Properties

AUTOMATION_LIBRARY

AUTOMATION_LIBRARY: str | None

The name of the automation library that the controller is using.

browser_type

browser_type: BrowserType

Return the type of the browser.

has_free_capacity

has_free_capacity: bool

Return if the browser has free capacity to open a new page.

idle_time

idle_time: timedelta

Return the idle time of the browser controller.

is_browser_connected

is_browser_connected: bool

Return if the browser is closed.

last_page_opened_at

last_page_opened_at: datetime

Return the time when the last page was opened.

pages

pages: list[Page]

Return the list of opened pages.

pages_count

pages_count: int

Returns the number of currently open pages.