Htmlq: like jq, but for html
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