xidel

Extract data from HTML, XML, and JSON using XPath and XQuery.

brewmacoslinux
Try with needOr install directly
Source

About

XPath/XQuery 3.0, JSONiq interpreter to extract data from HTML/XML/JSON

Commands

xidel

Examples

extract text from HTML by tag name$ xidel -e '//title/text()' https://example.com
pretty print JSON from a file$ xidel -e 'json' data.json
get all links from a web page$ xidel -e '//a/@href' https://example.com
extract specific XML elements and output as CSV$ xidel -e 'for $item in //item return concat($item/name, ",", $item/price)' data.xml
parse JSON and filter results by condition$ xidel -e 'json/data[age > 30]/name' data.json