use futures::StreamExt; use chromiumoxide::browser::{Browser, BrowserConfig}; #[async_std::main] async fn main() -> Result<(), Box> { tracing_subscriber::fmt::init(); let (browser, mut handler) = Browser::launch(BrowserConfig::builder().build()?).await?; let handle = async_std::task::spawn(async move { loop { let _ = handler.next().await.unwrap(); } }); let page = browser.new_page("https://en.wikipedia.org").await?; page.find_element("input#searchInput") .await? .click() .await? .type_str("Rust (programming language)") .await? .press_key("Enter") .await?; let _html = page.wait_for_navigation().await?.content().await?; handle.await; Ok(()) }