Skip to main content

Crate browser_commander

Crate browser_commander 

Source
Expand description

Browser Commander - Universal Browser Automation Library

A Rust library for browser automation that provides a unified API for different browser automation engines.

§Features

  • Unified API across multiple browser engines
  • Built-in navigation safety handling
  • Element visibility and scroll management
  • Click, fill, and other interaction support with verification
  • Async/await support with Tokio

§Example

use browser_commander::browser::{launch_browser, LaunchOptions};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    // Launch a browser
    let options = LaunchOptions::chromiumoxide().headless(true);
    let result = launch_browser(options).await?;

    // The returned `page` is an `Arc<dyn EngineAdapter>` and can be
    // passed to any of the crate's navigation / interaction helpers.
    let page = result.page.as_ref();
    page.goto("https://example.com").await?;
    println!("Current URL: {}", page.url().await?);

    Ok(())
}

§Modules

  • core - Core types and traits (constants, engine adapter, logger)
  • elements - Element operations (selectors, visibility, content)
  • interactions - User interactions (click, scroll, fill)
  • browser - Browser management (launcher, navigation)
  • utilities - General utilities (URL handling, wait operations)
  • high_level - High-level DRY utilities

Re-exports§

pub use browser::emulate_media;
pub use browser::launch_browser;
pub use browser::Browser;
pub use browser::ChromiumoxidePage;
pub use browser::ColorScheme;
pub use browser::EmulateMediaOptions;
pub use browser::LaunchOptions;
pub use browser::LaunchResult;
pub use browser::NodeBridgePage;
pub use core::DialogEvent;
pub use core::DialogManager;
pub use core::DialogType;
pub use core::EngineAdapter;
pub use core::EngineError;
pub use core::EngineType;
pub use core::Logger;
pub use core::LoggerOptions;
pub use core::PdfOptions;
pub use core::Timing;
pub use core::CHROME_ARGS;
pub use core::TIMING;

Modules§

browser
Browser management for browser automation.
core
Core functionality for browser automation.
elements
Element operations for browser automation.
high_level
High-level operations for browser automation.
interactions
Interaction operations for browser automation.
prelude
Prelude module for convenient imports.
utilities
Utilities for browser automation.