广州linux

当前位置:   网站首页 >> python

安装 html2text - python下类似php的strip_tags

html2text is a Python script that converts a page of HTML into clean, easy-to-read plain ASCII text. Better yet, that ASCII also happens to be valid Markdown (a text-to-HTML format).

类似于php的strip_tags


安装

cd /usr/local/bin/;

pip3 install html2text


you can use it from within Python:

import html2text 

print(html2text.html2text("<p>Hello, world.</p>"))


发表我的评论

Hi,您需要填写昵称和邮箱!

  • 必填项