#chrome #chromedriver #testing #headless #thirtyfour #browser #undetected

undetected-chromedriver

An undetected implementation of thirtyfour

3 releases

0.1.2 Sep 13, 2023
0.1.1 Sep 6, 2023
0.1.0 Jun 24, 2023

#4 in #thirtyfour

Download history 21/week @ 2024-06-17 34/week @ 2024-06-24 53/week @ 2024-08-05 3/week @ 2024-08-12 42/week @ 2024-08-19 2/week @ 2024-08-26 26/week @ 2024-09-02 20/week @ 2024-09-09 8/week @ 2024-09-16 34/week @ 2024-09-23 10/week @ 2024-09-30

72 downloads per month

MIT license

66KB
225 lines

rust undetected chrome driver logo
Rust undetected chromedriver

A rust implementation of ultrafunkamsterdam's undetected-chromedriver library based on thirtyfour

Installation

To use this library, you will need to have Rust and Cargo installed on your system. You can then add the following line to your Cargo.toml file:

[dependencies]
undetected-chromedriver = "0.1.2"

Usage

Here's an example of how you can use the undetected chromedriver in your Rust project:

use undetected_chromedriver::chrome;
use tokio;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let driver = chrome().await?;

    driver.goto("https://www.rust-lang.org/").await?;

    let title = driver.title().await?;
    println!("Title: {}", title);

    driver.quit().await?;

    Ok(())
}

Note: chrome needs to be installed on the system before using undetected chromedriver

Headless mode

You can run the chromedriver in headless mode by using xvfb-run. This will require you to have xvfb installed on your system.

Docker

A docker image is provided with chrome and xvfb installed. You can use it as follows:

FROM rust:latest as builder
COPY ./src ./src
COPY ./Cargo.toml ./Cargo.toml
COPY ./Cargo.lock ./Cargo.lock
RUN cargo build --release

FROM ghcr.io/ulyssedev/rust-undetected-chromedriver:latest
COPY --from=builder /target/release/binary /home/apps/binary
CMD ["/home/apps/binary"]

Dependencies

~17–34MB
~482K SLoC