跳转到主要内容

一个简单的包,用于从(即使是损坏的/无效的)HTML中提取文本

项目描述

一个简单的包,用于从(即使是损坏的/无效的)HTML中提取文本。无依赖项,它仅使用Python的内部HTMLParser进行一些调整。

用法

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

项目详情


下载文件

为您的平台下载文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

html_stripper-0.3.tar.gz (15.2 kB 查看哈希值)

上传时间:

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面