Skip to main content

A CLI tool to make HTML greppable

Project description

Greml

Make HTML greppable!

A simple tool to allow you to grep HTML.

Installation

The recommended way to install is to use pipx:

pipx install greml

Usage

Specify a HTML document, either piped as stdin, or a file or HTTP request and a selector (provided by Soup Sieve).

The output may be the text of the elements, a JSON representation of the element (including all attributes) that may be parsed further using jq or the value of specific attributes.

%  greml --help

 Usage: greml [OPTIONS] [INPUT_PATH] [SELECTOR]

╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│   input_path      [INPUT_PATH]  Input file path or URL. If not specified uses stdin. [default: (stdin)]                                                           │
│   selector        [SELECTOR]    HTML selector [default: None]                                                                                                     │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --display                     TEXT                             How to display, either 'text', 'json' or 'attr.ATTR' [default: text]                               │
│ --version             -v                                                                                                                                          │
│ --install-completion          [bash|zsh|fish|powershell|pwsh]  Install completion for the specified shell. [default: None]                                        │
│ --show-completion             [bash|zsh|fish|powershell|pwsh]  Show completion for the specified shell, to copy it or customize the installation. [default: None] │
│ --help                                                         Show this message and exit.                                                                        │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Exampless

% greml https://www.yourlifedoncaster.co.uk/trees-and-woodlands '#treeCounter'
108,000
% greml https://github.com/adamckay 'img[alt^="Achievement: "]' --display attr.alt | sort | uniq
Achievement: Arctic Code Vault Contributor
Achievement: Pull Shark
Achievement: Quickdraw
Achievement: YOLO

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

greml-1.0.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

greml-1.0.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file greml-1.0.0.tar.gz.

File metadata

  • Download URL: greml-1.0.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.10.16 Linux/6.8.0-1021-azure

File hashes

Hashes for greml-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f2843e438811bfc29cdab7d0c351bb6902184e5cc4686ac4ee3531cd7ec8beab
MD5 7f172a0452b06bde5e37e389f7be8f13
BLAKE2b-256 a09cfa851f5cbdfa19bdb6dfd24a8cf6a6a79f094e148b3b69004e7ac5950b1e

See more details on using hashes here.

File details

Details for the file greml-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: greml-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.10.16 Linux/6.8.0-1021-azure

File hashes

Hashes for greml-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd0faaa244c2be17a74348d97e71cfb8caedb049a977042f01d9d26906a6e5cc
MD5 6f0597c9e04f94f7d3d7ebba9143af83
BLAKE2b-256 97f296b09f9da5cf4d8015227cc3c71dc69d06f3e64e362e65b151a4a018d13c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page