Skip to main content

A simple package to extract text from (even broken/invalid) HTML

Project description

A simple package to extract text from (even broken/invalid) HTML. No dependencies, it just uses Python's internal HTMLParser with a few tweaks.

Usage:

from html_stripper import strip_tags
text = strip_tags("<html>…")
from html_stripper import strip_tags
import requests
strip_tags(requests.get("https://foo.bar/").text)
from html_stripper import strip_tags, strip_multiple_newlines
text = strip_multiple_newlines(strip_tags("<html>…")) # replaces chained newlines with a single \n

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

html_stripper-0.3.tar.gz (15.2 kB view hashes)

Uploaded Source

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