3 ms·
Will check it out, but would have preferred XPath selectors instead of CSS.
by turtlebits 4y ago
Will check it out, but would have preferred XPath selectors instead of CSS.
- wmichelin 4y agoWhy? CSS selectors are the normal web developer way to select content from a document. Even JavaScript adopted the approach.
- tuukkah 4y agoXPath supports more complex queries. In JavaScript, XPath is available as document.evaluate
- undume 4y agoxmllint can do that: curl example.org | xmllint --html --xpath '//some/xpath/selector' -
- jwilk 4y agoOnly if it's good old HTML 4. libxml2's parser doesn't grok HTML 5.
- BossHogg 4y agoThere's also https://github.com/charmparticle/xpe https://github.com/charmparticle/xpe
- natrys 4y agoAlso: https://github.com/benibela/xidel https://github.com/benibela/xidel
- curben 4y agoI'm using xmlstarlet in Alpine as a bare minimum way to scrap a webpage in CI pipeline.
- ludovicianul 4y agoThis has support for both XPath and CSS selectors: https://github.com/ludovicianul/hq https://github.com/ludovicianul/hq