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): None
  • Create a new instance.


    Parameters

    • browser: Browser
    • max_open_pages_per_browser: int = 20keyword-only

    Returns None

Methods

close

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

    • force: bool = Falsekeyword-only

    Returns None

new_page

  • async new_page(page_options): Page
  • Parameters

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

    Returns Page

Properties

AUTOMATION_LIBRARY

AUTOMATION_LIBRARY:

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