Skip to main content

BlockRequestsFunction

A function for blocking unwanted HTTP requests during page loads in PlaywrightCrawler.

It simplifies the process of blocking specific HTTP requests during page navigation. The function allows blocking both default resource types (like images, fonts, stylesheets) and custom URL patterns.

Index

Methods

Methods

__call__

  • async __call__(url_patterns, extra_url_patterns): None
  • Call dunder method.


    Parameters

    • optionalurl_patterns: list[str] | None = None

      List of URL patterns to block. If None, uses default patterns.

    • optionalextra_url_patterns: list[str] | None = None

      Additional URL patterns to append to the main patterns list.

    Returns None

Page Options