octaltree/playwright-rust

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

Opened this issue · 1 comments

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.

It throws an error on request parse.

  • Submit an improvement pr to the original.
  • or put a timeout on the client side

I'll think about it later.