octaltree / playwright-rust

Playwright port to Rust
316 stars 36 forks source link

page.evaluate_on_selector hangs indefinitely and doesn't timeout on error #28

Open randall-coding opened 2 years ago

randall-coding commented 2 years ago

I have two calls to page.evaluate_on_selector, the first completes, but the second seems to have a problem. Changing the order doesn't matter, so it looks like the problem is with my selector and I can fix that. The issue I want to address is that the error itself never occurs and the function simply hangs.

Here is the code in question:

let title_xpath = "xpath//*[@itemprop='title']";
let title: String = page.evaluate_on_selector::<String, String>(title_xpath,"node => node.innerHTML", None).await.unwrap();

I see the error in my code, but we should expect some kind of error to be produced* and visible, instead of the program hanging indefinitely.

octaltree commented 2 years ago

It throws an error on request parse.

I'll think about it later.