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§
- Captured
Cookie - A single captured browser cookie. Fields mirror the subset of
Network.Cookiethat’s relevant for replay.
Functions§
- apply_
to_ page - Apply previously-
capture_from_page-captured cookies to a freshpagevia BiDistorage.setCookie. Skips entries that have already expired; returns the count of cookies actually installed. - capture_
from_ page - Capture every cookie on
pagevia BiDistorage.getCookies. Includes HttpOnly cookies (no JavaScript limitation). - vendor_
cookies - Filter
cookiesto only those whose name matches one ofvendor’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.