Module browser

Module browser 

Source
Expand description

Browser entities: Window, Tab, Element.

This module contains the core types for browser automation:

  • Window - Browser window (owns Firefox process)
  • Tab - Browser tab with frame context
  • Element - DOM element reference Browser entities module.

This module provides the core browser automation types:

TypeDescription
WindowBrowser window (owns Firefox process, references shared pool)
TabBrowser tab (frame context)
ElementDOM element reference

§Example

use firefox_webdriver::{Driver, Result};

let driver = Driver::builder()
    .binary("/usr/bin/firefox")
    .extension("./extension")
    .build()
    .await?;

let window = driver.window().headless().spawn().await?;
let tab = window.tab();

tab.goto("https://example.com").await?;
let element = tab.find_element("h1").await?;
let text = element.get_text().await?;

Re-exports§

pub use element::Element;
pub use network::BodyAction;
pub use network::HeadersAction;
pub use network::InterceptedRequest;
pub use network::InterceptedRequestBody;
pub use network::InterceptedRequestHeaders;
pub use network::InterceptedResponse;
pub use network::InterceptedResponseBody;
pub use network::RequestAction;
pub use network::RequestBody;
pub use network::ResponseAction;
pub use proxy::ProxyConfig;
pub use proxy::ProxyType;
pub use tab::FrameInfo;
pub use tab::Tab;
pub use window::Window;
pub use window::WindowBuilder;
pub use crate::protocol::Cookie;

Modules§

element
DOM element interaction. DOM element interaction and manipulation.
network
Network interception types. Network interception types.
proxy
Proxy configuration types. Proxy configuration types.
tab
Browser tab automation. Browser tab automation and control.
window
Browser window management. Browser window management and control.