Thirtyfour-chromedriver

Crates.ioThirtyfour-chromedriver
lib.rsThirtyfour-chromedriver
version0.2.0
created_at2025-04-17 06:51:12.521573+00
updated_at2025-05-09 00:54:21.721102+00
descriptionSimple Rust library for installing chromedriver automatically
homepage
repositoryhttps://github.com/PARKasd/Thirtyfour-chromedriver
max_upload_size
id1637305
size91,204
parkm04 (PARKasd)

documentation

README

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.2.0"

Code Example1

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(())
}

Code Example2

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();
    let mut chromedriver = Handler::new()
        .launch_chromedriver_without_port(&mut caps)
        .await?;

    chromedriver.0.kill()?;
}
Commit count: 20

cargo fmt