20 lines
331 B
Python
20 lines
331 B
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from bs4 import BeautifulSoup
|
|
|
|
|
|
class ReUtil:
|
|
"""
|
|
正则表达式的工具类
|
|
"""
|
|
|
|
@staticmethod
|
|
def clear_html(text_with_html):
|
|
"""
|
|
清除html
|
|
"""
|
|
|
|
soup = BeautifulSoup(text_with_html, 'html.parser')
|
|
return soup.get_text()
|