hq

command module
v0.0.0-...-d901fe4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

README

hq

HTML query CLI using CSS selectors, built on top of Cascadia.

Installation

go get github.com/mightyguava/hq

Usage

hq 'div.class_name' test.html
cat test.html | hq 'div.class_name'

Special pseudo-selectors

Use the ::text pseudo-selector to recursively print the text nodes of matching nodes instead of rendering their HTML. Its behavior is the same as setting --text.

Use the ::attr(<attr>) pseuo-selector to print the value of a matching attribute in the matching nodes instead of than rendering the their html. For example, ::attr(href) prints the href value of the matching nodes. Each match is printed on a separate line. Non-matching nodes are skipped.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL