A simple xpath tool using golang xpath library.
go get -u github.com/angela0/xpd
xpd <selector> [filename]
For example:
xpd '//title' index.html
Arg filename
is optional, and xpd
will read data from stdin if not provided.
For example:
less index.html | xpd '//title'
# or
xpd '//title' < index.html
Some codes are from htmlquery protected by MIT.