web-grep
What this?
Grep for HTML or XML.
```bash
$ echo 'Hello' | web-grep '{}'
Hello
List up all
-innerHTML
$ cat << EOM | web-grep '
{}
'
hello
EOM
hello
world
# filtering with attributes
$ cat << EOM | web-grep '{}
'
hello
EOM
world
# Place-holder {} can be attribute
$ cat << EOM | web-grep 'world
'
hello
EOM
here
```
## How this?
This is a just CLI for an awesome library, [tanakh/easy-scraper](https://github.com/tanakh/easy-scraper).
## Installation
1. Install cargo
- Recommended Way: Install [rustup](https://rustup.rs/)
1. Then,
- `cargo install web-grep`
## Usage
```bash
$ web-grep
```
The `query` is a HTML (XML) Pattern.
Patterns are valid HTML structures which has exact one placeholder `{}` for innerHTMLs or attributes.
For example,
```html
{}
```
```html
{}
```
web-grep
outputs all text matching for {}
.
NOTE: The original library easy-scraper
uses tagged placeholders (e.g. {{xxx}}
), but web-grep
uses only {}
.