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 -i input.html > output.txt

To run against just specific areas identified by CSS selectors:

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

This can be called with multiple selectors:

cat input.html | strip-tags '.content' '.sidebar' > 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.2.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: strip-tags-0.2.tar.gz
  • Upload date:
  • Size: 7.3 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.2.tar.gz
Algorithm Hash digest
SHA256 f033359cec2c6d150498fd36fd1324b0b115644abe14be9973ea78dd9478100a
MD5 470682d544b50209f22a2d4c3c7399d2
BLAKE2b-256 59268e51d46fd0061431109a74236f391de6b089467904eb0f4bf2535eb87090

See more details on using hashes here.

File details

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

File metadata

  • Download URL: strip_tags-0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e5c7f66c7bcba939ce62dcab2f6a64d5d82073318b4ec5df6443a7c07d4c8f7f
MD5 282e7a27ec5241beb6111b2e010554b6
BLAKE2b-256 f8f411b71d4ffe6618a3e69d6d91ab405e9b600ccc961a6e85fefd60fe170880

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