Skip to main content

HeaderGenerator

crawlee.fingerprint_suite._header_generator.HeaderGenerator

Generates realistic looking or browser-like HTTP headers.

Index

Methods

get_common_headers

  • get_common_headers(): HttpHeaders
  • Get common HTTP headers ("Accept", "Accept-Language").

    We do not modify the "Accept-Encoding", "Connection" and other headers. They should be included and handled by the HTTP client or browser.


    Returns HttpHeaders

get_random_user_agent_header

  • get_random_user_agent_header(): HttpHeaders
  • Get a random User-Agent header.


    Returns HttpHeaders

get_sec_ch_ua_headers

  • get_sec_ch_ua_headers(*, browser_type): HttpHeaders
  • Get the Sec-Ch-Ua headers based on the browser type.


    Parameters

    • browser_type: BrowserType = 'chromium'keyword-only

    Returns HttpHeaders

get_user_agent_header

  • get_user_agent_header(*, browser_type): HttpHeaders
  • Get the User-Agent header based on the browser type.


    Parameters

    • browser_type: BrowserType = 'chromium'keyword-only

    Returns HttpHeaders