import re
with open('./sample_x.txt', 'r') as x:
content_x = x.read()
pre = re.compile(r'<[^>]+>',re.S)
str = pre.sub('',content_x)
print(str)
import re
with open('./sample_x.txt', 'r') as x:
content_x = x.read()
pre = re.compile(r'<[^>]+>',re.S)
str = pre.sub('',content_x)
print(str)
本文标题:python去除所有html标签的方法
本文链接:https://www.haomeiwen.com/subject/shjcsltx.html
网友评论