Skip to main content

Module cookies

Module cookies 

Source
Expand description

Captured browser cookies, preserve a solved-captcha session across page loads.

When a captcha is solved, the upstream WAF / vendor typically issues one or more cookies (cf_clearance, _pxhd, datadome, etc.) that grant the browser a window of trusted access. Without capturing + replaying these cookies, every navigation re-triggers the captcha challenge.

capture_from_page grabs every cookie from the live page after a successful solve. apply_to_page re-installs them on a fresh page so the next request rides the trusted session.

The capture path uses WebDriver BiDi storage.getCookies; the apply path uses storage.setCookie. Both are wrapped here so consumers don’t need to import rustenium BiDi storage types directly.

Structs§

CapturedCookie
A single captured browser cookie. Fields mirror the subset of Network.Cookie that’s relevant for replay.

Functions§

apply_to_page
Apply previously-capture_from_page-captured cookies to a fresh page via BiDi storage.setCookie. Skips entries that have already expired; returns the count of cookies actually installed.
capture_from_page
Capture every cookie on page via BiDi storage.getCookies. Includes HttpOnly cookies (no JavaScript limitation).
vendor_cookies
Filter cookies to only those whose name matches one of vendor’s known anti-bot tokens. Useful for trimming a full session capture down to the minimum subset that proves a vendor’s challenge passed : handy when you want to forward auth state to a non-browser HTTP client (curl/reqwest) without leaking unrelated session data.