| Crates.io | Thirtyfour-chromedriver |
| lib.rs | Thirtyfour-chromedriver |
| version | 0.2.0 |
| created_at | 2025-04-17 06:51:12.521573+00 |
| updated_at | 2025-05-09 00:54:21.721102+00 |
| description | Simple Rust library for installing chromedriver automatically |
| homepage | |
| repository | https://github.com/PARKasd/Thirtyfour-chromedriver |
| max_upload_size | |
| id | 1637305 |
| size | 91,204 |
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.
thirtyfourAdd these to your Cargo.toml:
[dependencies]
Thirtyfour-chromedriver = "0.2.0"
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(())
}
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()?;
}