Select 👁️ HTML

Extract HTML using CSS selectors in the command-line.

Features

Installation

Cargo

With a working Rust and Cargo installation, you can install select-html from Crates.io.

cargo install select-html

Binaries

Precompiled x86_64-unknown-linux-gnu binaries are available on the Releases page.

Examples

```sh

Use stdin to pipe HTML to select-html.

curl -s https://example.org | select-html

Or use --file.

select-html --file 'example.html'

Select and output HTML.

select-html 'title'

Output only the inner text of selected elements.

select-html '.example' --text

Output attribute values.

select-html '[property^="og:"]' -a 'property' -a 'content' ```

Usage

``` USAGE: select-html [OPTIONS]

ARGS: The CSS selector to use

OPTIONS: -a, --attribute Output the attribute's value from the selected element, can be used multiple times --file A HTML file to read, if not specified stdin will be used instead -h, --help Print help information -t, --text Output inner text of the selected elements --trim Trim whitespace from selected items -V, --version Print version information ```

Feedback

Found a problem or want to request a new feature? Email me@bauke.xyz and I'll see what I can do for you.

License

Distributed under the AGPL-3.0-or-later license, see LICENSE for more information.