Skip to main content

PlaywrightBrowserController

crawlee.browsers._playwright_browser_controller.PlaywrightBrowserController

Controller for managing Playwright browser instances and their pages.

This class provides methods to manage pages within a browser instance, ensuring that the number of open pages does not exceed the specified limit and tracking the state of the pages.

Index

Constructors

__init__

  • __init__(browser, *, max_open_pages_per_browser, header_generator): None
  • Create a new instance.


    Parameters

    • browser: Browser
    • max_open_pages_per_browser: int = 20keyword-only
    • header_generator: HeaderGenerator | None = _DEFAULT_HEADER_GENERATORkeyword-only

    Returns None

Methods

close

  • async close(*, force): None
  • Parameters

    • force: bool = Falsekeyword-only

    Returns None

new_page

  • async new_page(page_options, proxy_info): Page
  • Parameters

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

    Returns Page

Properties

AUTOMATION_LIBRARY

AUTOMATION_LIBRARY:

browser_type

browser_type: BrowserType

has_free_capacity

has_free_capacity: bool

idle_time

idle_time: timedelta

is_browser_connected

is_browser_connected: bool

last_page_opened_at

last_page_opened_at: datetime

pages

pages: list[Page]

pages_count

pages_count: int