chrome-driver-rs

Crates.iochrome-driver-rs
lib.rschrome-driver-rs
version0.1.2
created_at2025-09-19 02:37:24.621749+00
updated_at2025-09-19 02:56:45.948289+00
descriptionChromeDriver latest version downloader & manager for Rust
homepage
repositoryhttps://github.com/kyunghyunHan/chrome_driver_rs
max_upload_size
id1845693
size57,434
kyunhyun94 (kyunghyunHan)

documentation

README

chrome-driver-rs

A lightweight Rust library to automatically download, install, and verify the latest ChromeDriver for macOS (Intel/ARM) and Windows.

This library is especially useful when you need a ready-to-use ChromeDriver for projects using Selenium or thirtyfour without manual installation.


✨ Features

  • 🔄 Automatically fetches the latest stable version of ChromeDriver.
  • 💻 Supports:
    • macOS (Intel/x64 and Apple Silicon ARM64)
    • Windows 64-bit
  • ⚡ Async API using Tokio.
  • 🚀 Automatically sets executable permissions on Unix systems.

📦 Installation

Add this crate to your Cargo.toml:

[dependencies]
chrome-driver-rs = "0.1"
tokio = { version = "1", features = ["full"] }
reqwest = { version = "0.11", features = ["json"] }
zip = "0.6"
serde_json = "1"

🚀 Quick Start

use chrome_driver_rs::{ensure_latest_driver, check_version};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Download and install the latest ChromeDriver
    let driver_info = ensure_latest_driver("./driver").await?;
    println!("ChromeDriver path: {}", driver_info.driver_path);
    println!("Installed version: {}", driver_info.version);

    // (Optional) Verify that the driver is working
    check_version(&driver_info.driver_path).await?;

    Ok(())
}

This will:

  1. Download the latest stable ChromeDriver.
  2. Extract it into the ./driver folder.
  3. Print the executable path and version.

🔧 Example Integration with thirtyfour

use chrome_driver_rs::ensure_latest_driver;
use thirtyfour::prelude::*;

#[tokio::main]
async fn main() -> WebDriverResult<()> {
    let driver = ensure_latest_driver("./driver").await?;
    let caps = DesiredCapabilities::chrome();
    let webdriver = WebDriver::new("http://localhost:9515", caps).await?;

    webdriver.goto("https://www.google.com").await?;
    println!("Chrome opened successfully!");
    webdriver.quit().await?;

    Ok(())
}

📜 License

Licensed under either of

Commit count: 0

cargo fmt