cat file.html | tq
[] SELECTOR
Perform a css query with SELECTOR on an html document passed to the standard input.
-
SELECTOR A css selector
-
-a
ATTRIBUTE--attr=
ATTRIBUTE Outputs only the contents of the html ATTRIBUTE. -
-t, --text
Outputs only the inner text of the selected elements. -
-p, --parent
Select the elements instead. -
-q, --squash
Squash lines. -
-s, --squash-space
Squash spaces. -
-j, --json-lines
JSON encode each match. -
-J, --json
Output as json array of strings. -
-v, --version
Prints tq version
curl https://news.ycombinator.com/news | tq -tj ".title a"
curl -s 'https://www.flickr.com/photos/tgerus/galleries/72157622468645106/' \
| tq " .pc_img" -a src \
| wget -i
tq
was written by Pedro pedroghcode@gmail.com.
The latest version of tq may be downloaded from https://github.com/plainas/tq
curl(1), wget(1), jq(1)