Command-line utility to perform XPath queries on HTML or XML documents.
$ htmlpath somefile.html //a/@href
http://foo.example.com
usage: htmlpath [-h] [file] expression
positional arguments:
file an HTML or XML file (defaults to stdin)
expression an XPath expression
optional arguments:
-h, --help show this help message and exit
Optional installation:
ln -s /path/to/htmlpath.py /usr/bin/htmlpath
- Python 2.7 (other versions may work, too)
- Scrapy to do the parsing