You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let (mut browser, mut handler) = Browser::launch(
//notice how removing enable_request_intercept() would make it works
BrowserConfig::builder().enable_request_intercept().request_timeout(Duration::from_secs(10))
.disable_cache()
.build()?,
)
.await?;
let browser_handle = async_std::task::spawn(async move {
while let Some(h) = handler.next().await {
if h.is_err() {
break;
}
}
});
//This is working
//let page = Arc::new(browser.new_page("https://wikipedia.org/").await?);
//page.wait_for_navigation().await?;
//page.find_element("input#searchInput")
// .await?
// .click()
// .await?
// .type_str("Rust programming language")
// .await?
// .press_key("Enter")
// .await?;
//This does not, it would just time out. But removing enable_request_intercept() would make it works
let page = Arc::new(browser.new_page("about:blank").await?);
page.goto("https://wikipedia.org/").await?;
page.wait_for_navigation().await?;
println!("{:?}", page.content().await?);
browser.close().await?;
browser_handle.await;
Ok(())
}
`
The text was updated successfully, but these errors were encountered:
EpixMan
changed the title
enable_request_intercept() with "about:blank" as the new page would cause timeout
enable_request_intercept() with page.goto()
Aug 4, 2024
I am new to chromiumoxide so please tell me if I did something wrong.
EDIT: I did some experimentation and found that the problem is not with "page:blank", but rather with page.goto()
Upon experiencing how chromiumoxide works, I tried to modify the file in https://github.com/mattsse/chromiumoxide/blob/main/examples/interception.rs which creates a new page with "about:blank", for some reason, page.goto would do nothing then gives Timeout error.
I think it would be simpler to show the code:
`use std::sync::Arc;
use std::time::Duration;
use futures::StreamExt;
use chromiumoxide::browser::{Browser, BrowserConfig};
#[async_std::main]
async fn main() -> Result<(), Box> {
tracing_subscriber::fmt::init();
}
`
The text was updated successfully, but these errors were encountered: