Expand description
Cloudflare Turnstile bypass for zendriver.
See the Cloudflare chapter of the zendriver-rs user guide for end-to-end usage, timeout tuning, and detection-failure diagnostics.
Drives the Turnstile checkbox click flow:
- Detect the Turnstile iframe via a shadow-DOM-aware walk of the page’s main world.
- Dispatch a raw left-click at the 15% × 50% offset inside the iframe bbox (the canonical Turnstile checkbox location).
- Poll for either the
cf-turnstile-responseinput gaining a token, or the challenge container disappearing entirely.
Most users go through zendriver’s Tab::cloudflare() (feature-gated)
rather than constructing the bypass directly. The
CloudflareBypass type is the underlying driver.
use std::time::Duration;
use zendriver_cloudflare::{CloudflareBypass, ClearanceOutcome};
let outcome = CloudflareBypass::new(tab)
.wait_for_clearance(Duration::from_secs(30))
.await?;
match outcome {
ClearanceOutcome::TokenAcquired(token) => println!("got token: {token}"),
ClearanceOutcome::ChallengeGone => println!("challenge cleared"),
}Re-exports§
pub use bypass::ClearanceOutcome;pub use bypass::CloudflareBypass;pub use error::CloudflareError;