Use as a Rust library
Add the dependency
[dependencies]
obscura = { git = "https://github.com/h4ckf0r0day/obscura" }
tokio = { version = "1", features = ["rt", "macros"] }
anyhow = "1"obscura = { git = "https://github.com/h4ckf0r0day/obscura", tag = "v0.1.7" }Quickstart
use obscura::Browser;
use std::time::Duration;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let browser = Browser::builder()
.stealth(true)
.build()?;
let mut page = browser.new_page().await?;
page.goto("https://example.com").await?;
println!("URL: {}", page.url());
println!("HTML bytes: {}", page.content().len());
let el = page.wait_for_selector("h1", Duration::from_secs(5)).await?;
println!("Heading: {}", el.text());
let title = page.evaluate("document.title");
println!("Title: {}", title);
Ok(())
}API surface
Intercept requests
Passive callbacks
Active interception
Preload scripts
When to use which interface
Last updated
Was this helpful?

