HeaderGenerator
Index
Methods
__init__
Returns None
get_common_headers
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 a random User-Agent header.
Returns HttpHeaders
get_sec_ch_ua_headers
Get the sec-ch-ua headers based on the browser type.
Parameters
optionalkeyword-onlybrowser_type: SupportedBrowserType = 'chromium'
Returns HttpHeaders
get_specific_headers
Return subset of headers based on the selected
header_names
.If no
header_names
are specified, full unfiltered headers are returned.Parameters
optionalheader_names: set[str] | None = None
optionalbrowser_type: SupportedBrowserType = 'chromium'
Returns HttpHeaders
get_user_agent_header
Get the User-Agent header based on the browser type.
Parameters
optionalkeyword-onlybrowser_type: SupportedBrowserType = 'chromium'
Returns HttpHeaders
Generate realistic looking or browser-like HTTP headers.