zendriver-interception 0.1.0

Network interception (Fetch.* CDP domain) for zendriver
Documentation

zendriver-rs

Async-first, undetectable browser automation via the Chrome DevTools Protocol.

crates.io docs.rs Book MSRV 1.85 License: MIT OR Apache-2.0 CI

A Rust port of zendriver. Drives Chrome via raw CDP โ€” no WebDriver, no JS shim โ€” with anti-detection patches baked in by default.

๐Ÿ“– User guide & full documentation โ†’ ยท ๐Ÿฆ€ API reference (docs.rs) โ†’

Quick example

use zendriver::Browser;

#[tokio::main]
async fn main() -> zendriver::Result<()> {
    let browser = Browser::builder().headless(true).launch().await?;
    let tab = browser.main_tab();

    tab.goto("https://example.com").await?;
    tab.wait_for_load().await?;

    // Find by visible text (auto-waits up to the selector's timeout).
    let link = tab.find().text("More information...").one().await?;
    link.click().await?;
    tab.wait_for_load().await?;

    // Read back from the page's main world.
    let title: String = tab.evaluate_main("document.title").await?;
    println!("title: {title}");

    browser.close().await?;
    Ok(())
}

More working examples in crates/zendriver/examples/.

Feature matrix

Feature Default? Use case Extra deps
stealth yes Anti-detection: spoofed UA/platform, isolated worlds, JS shim (built-in to zendriver)
interception no Block/modify requests via CDP Fetch.*; rule-based + streams zendriver-interception
expect no Playwright-style expect_response() / expect_request() (in-tree, no extra crate)
cloudflare no Solve Cloudflare Turnstile challenges zendriver-cloudflare
fetcher no Auto-download a pinned Chrome for Testing build zendriver-fetcher + reqwest/zip

Install

Pick the use case that matches what you're building.

Just browse:

cargo add zendriver

Default stealth is on.

Stealth scraping (explicit):

cargo add zendriver --features stealth

Same as above โ€” only spell out the feature if you want it visible in Cargo.toml.

Everything:

cargo add zendriver --features "interception expect cloudflare fetcher"

Adds request interception, expect() matchers, Cloudflare Turnstile bypass, and the Chrome for Testing fetcher.

Phases

Six development phases shipped into the v0.1.0 release. The mdBook covers each surface in depth.

  1. Foundation โ€” CDP transport + minimal Browser/Tab/Element. See introduction.
  2. Stealth โ€” fingerprint patches + isolated worlds + stealth JS bundle. See stealth.
  3. Element API completeness โ€” CSS/XPath/text/role selectors, actionability, input controller, screenshots. See quickstart.
  4. Tab/Browser completeness โ€” multi-tab, cookies, storage, frames, nav history, wait_for_idle. See multi-tab + frames.
  5. Optional gated features โ€” request interception, expect() matchers, Cloudflare bypass, Chrome-for-Testing fetcher. See interception, expect, cloudflare, fetcher.
  6. Polish + release โ€” trait extraction, rustdoc + mdBook, publish to crates.io.

Comparison

Feature zendriver-rs chromiumoxide fantoccini headless_chrome thirtyfour
API ergonomics opinion builder + auto-wait raw CDP types WebDriver verbs sync wrappers WebDriver verbs
Stealth out-of-box yes (default) no no no no
Multi-tab yes (first-class) yes yes yes yes
Interception yes (Fetch.* wrapper) yes (raw) no (proxy-only) partial no (proxy-only)
License MIT OR Apache-2.0 MIT OR Apache-2.0 Apache-2.0 MIT MIT
Async runtime tokio tokio / async-std tokio sync tokio

Subjective rows marked *opinion. All claims accurate as of the 0.1.0 release; check upstream changelogs before relying on them.

Contributing

See CONTRIBUTING.md. Issues and PRs welcome.

License

Dual-licensed under MIT (LICENSE-MIT) and Apache-2.0 (LICENSE-APACHE) at your option.