Skip to main content

Strip tags from HTML, optionally from areas identified by CSS selectors

Project description

strip-tags

PyPI Changelog Tests License

Strip tags from HTML, optionally from areas identified by CSS selectors

Installation

Install this tool using pip:

pip install strip-tags

Usage

Pipe content into this tool to strip tags from it:

cat input.html | strip-tags > output.txt

Or pass a filename:

strip-tags input.html > output.txt

To run against just specific areas identified by CSS selectors:

strip-tags -s '.content' input.html > output.txt

This can be called with multiple selectors:

strip-tags -s '.content' -s '.sidebar' input.html > output.txt

You can also use:

python -m strip_tags --help

Development

To contribute to this tool, first checkout the code. Then create a new virtual environment:

cd strip-tags
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

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

strip-tags-0.1.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

strip_tags-0.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file strip-tags-0.1.tar.gz.

File metadata

  • Download URL: strip-tags-0.1.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for strip-tags-0.1.tar.gz
Algorithm Hash digest
SHA256 e651e5f1fdf6f59628174a8ef27f84c97705b825245f9b3e393f866dca5104c6
MD5 3c995a2fe337a6ea38d78dd695a8f952
BLAKE2b-256 5ee58cc421e0cdb86888a6df44919c86cff404df1f6b8069227fa90ab43a9d8b

See more details on using hashes here.

File details

Details for the file strip_tags-0.1-py3-none-any.whl.

File metadata

  • Download URL: strip_tags-0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for strip_tags-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9dee6f2ff8f064af9cf1780c21453f698f81ca882a12baced4a4341d8dc76f0b
MD5 aa70ff97fd28d16bb8fd7b525799bb9a
BLAKE2b-256 47af13ef6d1161e5ba8182c724746559cc7f14d3dafb1d87ce0caff551a35c41

See more details on using hashes here.

Supported by

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