browsing 0.1.7

Browser automation: navigate, click, extract, screenshot. Standalone browser control via CDP.
Documentation
//! HAR capture with request/response body access
//!
//! cargo run --example har_capture

use browsing::browser::{Browser, BrowserProfile};
use std::sync::Arc;

#[tokio::main]
async fn main() -> browsing::Result<()> {
    let mut browser = Browser::new(BrowserProfile::default());
    browser.start().await?;

    // Use new_with_body for response body capture
    let client = Arc::clone(&browser.get_cdp_client()?);
    let har = browsing::HarManager::new_with_body(client);
    har.start_capture().await?;

    browser.navigate("https://httpbin.org/html").await?;
    tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;

    let count = har.entry_count().await;
    println!("Captured {} entries", count);

    let har_log = har.export_har().await;
    std::fs::write("capture.har", serde_json::to_string_pretty(&har_log)?)?;
    println!("HAR saved: capture.har");
    Ok(())
}