#chrome-driver #thirtyfour #automatic #binary #chrome-drivers

Thirtyfour-chromedriver

Simple Rust library for installing chromedriver automatically

8 releases

Uses new Rust 2024

new 0.2.0 May 9, 2025
0.1.6 May 4, 2025
0.1.4 Apr 27, 2025

#506 in Hardware support

Download history 377/week @ 2025-04-16 113/week @ 2025-04-23 243/week @ 2025-04-30

458 downloads per month

MIT license

23KB
269 lines

Rust + Thirtyfour: Auto ChromeDriver Installer

This Rust project automatically downloads the correct version of ChromeDriver based on the version of Chrome installed on your system. It uses the thirtyfour crate for WebDriver automation, and integrates tools to fetch, unzip, and launch the matching driver. I'm newbie in Rust so code is dirty.

🚀 Features

  • Detect installed Chrome version (cross-platform support)
  • Automatically download the matching ChromeDriver
  • Unzip and configure the driver binary
  • Launch Chrome using thirtyfour
  • Manage Old ChromeDrivers

📦 Dependencies

Add these to your Cargo.toml:

[dependencies]
Thirtyfour-chromedriver = "0.1.5"

Code Example

use thirtyfour::prelude::*;

// Require the Handler
use thirtyfour_chromedriver::{manager::Handler};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    // Create Chrome capabilities
    let mut caps = DesiredCapabilities::chrome(); 

    // Launch chromedriver on port 9515 
    let mut chromedriver = Handler::new()
        .launch_chromedriver(&mut caps, "9515")
        .await?;

    // Connect to chrome on the same port
    let driver = WebDriver::new("http://localhost:9515", caps).await?; 

    // Close the proccess after tasks are finished
    chromedriver.kill()?;

    Ok(())
}

Dependencies

~18–32MB
~453K SLoC