Crates.io | webdriver-downloader |
lib.rs | webdriver-downloader |
version | 0.16.0 |
source | src |
created_at | 2023-02-10 06:55:25.899099 |
updated_at | 2024-06-13 08:50:25.113106 |
description | Library for webdriver download. |
homepage | https://github.com/ik1ne/webdriver-downloader |
repository | https://github.com/ik1ne/webdriver-downloader |
max_upload_size | |
id | 781689 |
size | 70,868 |
Library for webdriver download. Supports chromedriver(both Chrome and Chrome for Testing), geckodriver for Windows, Linux and macOS.
use webdriver_downloader::prelude::*;
#[tokio::main]
async fn main() {
let driver_info = ChromedriverInfo::new_default().unwrap();
// Tries up to 5 versions of webdrivers if it is not installed.
if !driver_info.is_installed() {
driver_info.download_verify_install(5).await.unwrap();
}
// webdriver is installed.
// Default installation path is %USERPROFILE%/bin/chromedriver.exe ($HOME/bin/chromedriver for unix family)
}
By implementing WebdriverUrlInfo, WebdriverInstallationInfo, WebdriverVerificationInfo
, trait WebdriverDownloadInfo
is automatically implemented for struct CustomDriverInfo
.
Then you can call custom_driver_info.download_verify_install(max_attempts)
.
The library's implementation of WebdriverVerificationInfo::verify_driver
uses fantoccini
to verify installed driver.
Since fantoccini
requires tokio
as runtime, you need to use tokio
as runtime to use library provided driver downloader.