Skip to main content

Module page

Module page 

Source
Expand description

§Resource blocking

§Wait strategies

PageHandle exposes three wait strategies via WaitUntil:

  • DomContentLoaded — fires when the HTML is parsed

§Example

use stygian_browser::{BrowserPool, BrowserConfig};
use stygian_browser::page::{ResourceFilter, WaitUntil};
use std::time::Duration;

let pool = BrowserPool::new(BrowserConfig::default()).await?;
let handle = pool.acquire().await?;

let mut page = handle.browser().expect("valid browser").new_page().await?;
page.set_resource_filter(ResourceFilter::block_media()).await?;
page.navigate("https://example.com", WaitUntil::DomContentLoaded, Duration::from_secs(30)).await?;
let title = page.title().await?;
println!("title: {title}");
handle.release().await;

Structs§

NodeHandle
more CDP Runtime.callFunctionOn calls against the held V8 remote object reference — no HTML serialisation occurs.
PageHandle
Example
ResourceFilter
Example

Enums§

ResourceType
CDP resource types that can be intercepted.
WaitUntil
Example