Live data from Hacker News

Htmlq: like jq, but for html

github.com

171–172 of 172 posts

Re: Htmlq: like jq, but for html

#171
shameless self promotion: parsel[0] is a python script in front of the identically named python lib, and extracts parts of the HTML by CSS selector. the advantage of it compared to most similar tools is that you can navigate in the DOM tree up and down to find precisely what you want if the HTML is poorly marked up, or the searched parts are not close to each other.

[0] https://github.com/bAndie91/tools/blob/master/usr/bin/parsel

Re: Htmlq: like jq, but for html

#172
post #46

Earlier quoted context omitted.

Thanks, this looks more powerfull. Support CSS, XPath and XQuery. Maybe I could learn a bit of XQuery when I have a use case for it :)

Everything that isn't a (: happy comments :) is a FLWOR: { for $user in //users let $comments = //comment[@uid = $user/@id] where count($comments) > 0 order by $user/lastName, $user/firstName return { concat($user.firstName, " ", $user.lastName) } { for $c in $comments return } } It's the bastard child of SQL and XPath 2 lol. http://www.stylusstudio.com/xquery-flwor.html

I kinda liked XQuery, but it seemed to never have got much traction.
Post reply on HN