hq

Command-line tool for querying and extracting data from HTML

brewmacoslinux
Try with needOr install directly
Source

About

Jq, but for HTML

Commands

hq

Examples

Extract all links from an HTML file$ hq 'a' index.html | hq -r '@href'
Get the text content of all h1 headers$ cat page.html | hq -r 'h1'
Extract data from specific HTML elements with class$ hq '.container .title' data.html | hq -r 'text'