Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pystardust/shup
A POSIX shell script to parse HTML
https://github.com/pystardust/shup
html posix scraping shell
Last synced: 2 months ago
JSON representation
A POSIX shell script to parse HTML
- Host: GitHub
- URL: https://github.com/pystardust/shup
- Owner: pystardust
- License: gpl-3.0
- Created: 2021-04-13T13:20:53.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-05-20T06:31:20.000Z (over 3 years ago)
- Last Synced: 2024-10-25T06:00:43.956Z (3 months ago)
- Topics: html, posix, scraping, shell
- Language: Shell
- Homepage:
- Size: 21.5 KB
- Stars: 37
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Shup
Simple HTML parser in shell.
- Requires
* POSIX shell
* sed## Installation
To install `shup` you can edit the `Makefile` to match your local setup (`shup` is installed into the `/usr/local/bin` by default).Afterwards enter the following command to install `shup`:
```sh
sudo make install
```To uninstall `shup`, just run:
```sh
sudo make uninstall
```## Usage
```sh
USAGE: shup [OPTIONS] ["FILTER1" "FILTER2" ...]
-h show this help
-v show version
-r raw: last filter tag will not be shown
-t text: no tags will be shown
-o "string" specify output indentationFILTER FORMAT: "" or "[]"
the search string should be present in the tag line
EXAMPLE
to match all div tags
shup "div"
to match div tags with some string
shup "div[Qynugf]"
will match :The string could be present anywhere inside the tags body <.>
Patterns can be specified in the string using shell patterns
shup "div[Qy?*[!h]f]"
When no filters applied, shup will only format the HTML
```## Example
```sh
curl -s "www.gnu.org" | shup -r "body" "div[inner]" "ul" "li[[pP]hilo]" "a"
```