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

What about an XPathEvaluator ? #172

Open
Siltaar opened this issue Jul 9, 2024 · 1 comment
Open

What about an XPathEvaluator ? #172

Siltaar opened this issue Jul 9, 2024 · 1 comment

Comments

@Siltaar
Copy link

Siltaar commented Jul 9, 2024

To connect #73 and #143 I can testify that it exists real-life use-cases for XPathEvaluators, such as reaching namespaced elements in an RSS file.

The .evaluate() function is provided on DOM nodes in Firefox :
https://developer.mozilla.org/fr/docs/Web/API/Document/evaluate

That would be great to have it here also.

Going through nearly one thousand website scrapping I identified some cases where XPath look mandatory to me :

  • search in ancestors of a node
  • going through a flat structure (with following-sibling)
  • selecting a node from its content
  • specifying the 2nd text child of a node
  • and even getting some content out of HTML comments

The good news is that there is nothing worst behind XPath. I don't have use-cases for something fancier or weirder… after HTML and RSS we hardly encounter worse than JSON on the web, except for multipart/form-data content-types in some POST requests.

@b-fuze
Copy link
Owner

b-fuze commented Jul 14, 2024

I am not opposed to this, I'd just need to see what existing implementations are out there

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