Hacker News new | past | comments | ask | show | jobs | submit login

Would love to have a nokogiri-level xpath or css3 selector capabilities. I'm up to my neck with projects, but this looks like a good start: https://github.com/jgehring/hcxselect/tree/83d3edaa8a6944d20...



We have libxml2 bound in the stdlib with xpath support, do you need more?


Yes! it would take a lot of hard work to convert all my css3 selectors to xpath.


I think having css3 to xpath selector conversion in the stdlib (or perhaps a shard based on how complex it is)would be possible. It would be great if you could open an issue in crystal's repo.


This shard implements a CSS selector API on top of an html parser: https://github.com/kostya/modest


If only it was compatible with the existing XML interface...


XML has way more surface area than HTML, you could only query a small subset of valid XML documents with CSS. Plus, these days nobody uses XML parsers for HTML anymore, their behavior has diverged; things like behaviour of unclosed elements, valid children tags, are defined in the HTML spec and not possible in XML.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: