安装 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>"))


你可能感兴趣的:(python)