//! Simple example of using orb-browse
//!
//! Run with: cargo run --example simple

use orb_browse::OrbBrowser;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    println!("🔮 orb-browse Example");
    println!("======================\n");

    println!("Creating browser...");
    let browser = OrbBrowser::new().await?;

    println!("Navigating to Google (bypassing bot detection)...");
    let screenshot = browser.capture("https://google.com", 1920, 1080).await?;

    let output_path = "google.png";
    std::fs::write(output_path, &screenshot)?;

    println!("✅ Screenshot saved to: {}", output_path);
    println!("\nIf this worked, you successfully bypassed Google's bot detection!");

    browser.close().await?;

    Ok(())
}
