b-fuze / deno-dom

Browser DOM & HTML parser in Deno
https://jsr.io/@b-fuze/deno-dom
MIT License
421 stars 48 forks source link

What about an XPathEvaluator ? #172

Open Siltaar opened 3 months ago

Siltaar commented 3 months ago

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 :

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 commented 3 months ago

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