FetcherSession
A factory context manager that provides configured fetcher sessions for HTTP requests. Useful for maintaining persistent connections and reusing configurations across multiple requests.Constructor
str | list
default:"chrome"
Browser version to impersonate. Can be a single browser string or a list of browser strings for random selection
bool
default:"False"
Whether to use HTTP3. Might be problematic if used with
impersonatebool
default:"True"
If enabled, creates and adds real browser headers. Also sets the referer header as if this request came from a Google search of URL’s domain
dict
Dict of proxies to use. Format:
{"http": proxy_url, "https": proxy_url}str
Proxy URL to use. Format:
"http://username:password@localhost:8030". Cannot be used together with the proxies parametertuple
HTTP basic auth for proxy, tuple of (username, password)
int | float
default:"30"
Number of seconds to wait before timing out
dict
Headers to include in the session with every request
int
default:"3"
Number of retry attempts
int
default:"1"
Number of seconds to wait between retry attempts
bool
default:"True"
Whether to follow redirects
int
default:"30"
Maximum number of redirects. Use -1 for unlimited
bool
default:"True"
Whether to verify HTTPS certificates
str | tuple
Tuple of (cert, key) filenames for the client certificate
dict
Arguments passed when creating the final Selector class
ProxyRotator
A ProxyRotator instance for automatic proxy rotation
Methods
When used as a context manager,FetcherSession yields a session object with the following methods:
get()
Fetcher.get().
post()
Fetcher.post().
put()
Fetcher.put().
delete()
Fetcher.delete().
Async Usage
StealthySession
A stealthy browser session manager with page pooling. Maintains a persistent browser context for multiple requests.Constructor
Accepts all parameters fromStealthyFetcher.fetch(). The session maintains these settings across all fetch calls.
Methods
start()
fetch()
StealthyFetcher.fetch(), which can override session defaults.
str | dict
Static proxy to override rotator and session proxy. A new browser context will be created and used with it
StealthyFetcher.fetch().
AsyncStealthySession
Asynchronous version ofStealthySession.
Methods
start()
fetch()
DynamicSession
A browser session manager with page pooling using Playwright.Constructor
Accepts all parameters fromDynamicFetcher.fetch(). The session maintains these settings across all fetch calls.
Methods
start()
fetch()
DynamicFetcher.fetch().
AsyncDynamicSession
Asynchronous version ofDynamicSession.
Constructor
int
The maximum number of tabs to be opened at the same time. Used in rotation through a PagePool
DynamicFetcher.fetch().