Crate bench_scraper
source ·Expand description
Bench Scraper is a library for grabbing browser cookies from a filesystem.
Different browsers store their cookies in different locations, with different encryption methods, in different ways across operating system. Bench scraper abstracts this complexity into a few easy-to-use functions.
let browser_cookies = bench_scraper::find_cookies().unwrap();
for browser_cookie in browser_cookies.iter() {
println!("Cookies for '{:?}'", browser_cookie.browser);
for cookie in browser_cookie.cookies.iter() {
println!(" '{:?}'", cookie);
}
}
Using the reqwest
feature, you can turn an iterator of cookies directly into a cookie jar.
let browser_cookie = bench_scraper::find_cookies().unwrap().into_iter().next().unwrap();
let jar: reqwest::cookie::Jar = browser_cookie.cookies.into_iter().collect();
This library attempts to support a wide range of operating systems and browsers, however functionality for certain browsers on certain systems may fail at runtime.
Structs
A single HTTP cookie.
A set of cookies that come from a specific browser.
Enums
Enum listing possible errors from bench scraper operations.
A browser from which cookies can be pulled.
A web browser engine that handles the core functionality of a web browser.
Functions
Fetches all the cookies from all the known browsers for the current user
Fetches all the cookies from a given browser with a given config path
Parses a binarycookie payload into actual cookies.