htmlgrep is a suite of command-line tools for searching HTML documents, that allows selecting elements by various types of selectors.
It currently only provides a single utility program:
Document.querySelectorAll()
.
TODO.
You can also use htmlgrep programmatically:
extern crate htmlgrep; fn main() { let input = r#" <!doctype html> <meta charset=utf> <title>My first blog post</title> <meta name=keywords content=blog,first,hello> <meta name=description content="First entry to blog."> "#; let matches = htmlgrep::select("meta[name=keywords]", input.as_bytes()).unwrap(); for node in matches { println!("{}", node.source); } }
Install with cargo install htmlgrep
.
Download current or past releases.
Clone the repo from git clone https://git.sny.no/htmlgrep
.
See the README for build instructions.