๐Ÿ“ฆ djberube / Rust-undetected-chromedriver

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

โ˜… 0 stars โ‘‚ 0 forks ๐Ÿ‘ 0 watching โš–๏ธ MIT License
๐Ÿ“ฅ Clone https://github.com/djberube/Rust-undetected-chromedriver.git
HTTPS git clone https://github.com/djberube/Rust-undetected-chromedriver.git
SSH git clone git@github.com:djberube/Rust-undetected-chromedriver.git
CLI gh repo clone djberube/Rust-undetected-chromedriver
UlysseDev UlysseDev โœจ Add cloudflare bypass 29222ff 2 years ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ src
๐Ÿ“ tests
๐Ÿ“„ .gitignore
๐Ÿ“„ Cargo.toml
๐Ÿ“„ Dockerfile
๐Ÿ“„ LICENSE
๐Ÿ“„ README.md
๐Ÿ“„ xvfb.sh
๐Ÿ“„ README.md

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"]