Skip to content

matthewransley/reqwest-impersonate

 
 

Repository files navigation

reqwest-impersonate

A fork of reqwest-impersonate, designed to provide more functionality and stability

Notice: This crate depends on patched dependencies. To use it, please add the following to your Cargo.toml.

[patch.crates-io]
hyper = { git = "https://github.com/4JX/hyper.git", branch = "v0.14.18-patched" }
h2 = { git = "https://github.com/4JX/h2.git", branch = "imp" }

Example

Cargo.toml

reqwest-impersonate = { git = "https://github.com/epicmatthew23/reqwest-impersonate.git", default-features = false, features = [
    "chrome",
    "blocking",
] }

main.rs

use reqwest_impersonate::browser::ChromeVersion;

fn main() {
    // Build a client to mimic Chrome 114
    let client = reqwest_impersonate::blocking::Client::builder()
        .chrome_builder(ChromeVersion::V114)
        .build()
        .unwrap();

    // Use the API you're already familiar with
    match client.get("https://yoururl.com").send() {
        Ok(res) => {
            println!("{:?}", res.text().unwrap());
        }
        Err(err) => {
            dbg!(err);
        }
    };
}

About

Impersonating the Chrome browser made easy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 99.6%
  • Other 0.4%