Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
randall-coding opened this issue Apr 22, 2022 · 1 comment

Comments

@randall-coding
Copy link

randall-coding commented Apr 22, 2022

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants