#web-driver #chromedriver #geckodriver

webdriver-downloader

Library for webdriver download

43 releases

0.14.3 Feb 15, 2024
0.14.1 Jan 4, 2024
0.14.0 Sep 29, 2023
0.13.6 Jul 26, 2023
0.5.1 Mar 31, 2023

#491 in Web programming

Download history 12/week @ 2023-12-31 1/week @ 2024-01-07 8/week @ 2024-01-28 81/week @ 2024-02-11 14/week @ 2024-02-18 55/week @ 2024-02-25 25/week @ 2024-03-03 18/week @ 2024-03-10 2/week @ 2024-03-17

100 downloads per month
Used in 2 crates

MIT license

65KB
1.5K SLoC

webdriver-downloader

Crates.io

Library for webdriver download. Supports chromedriver(both Chrome and Chrome for Testing), geckodriver for Windows, Linux and macOS.

Usage

Using library provided driver downloader

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

Implementing downloader for custom driver

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).

Notes on runtime

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.

Dependencies

~19–36MB
~612K SLoC