mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 13:56:10 +00:00
14 lines
309 B
Python
14 lines
309 B
Python
from bs4 import BeautifulSoup
|
|
|
|
|
|
def remove_tags(html):
|
|
# parse html content
|
|
soup = BeautifulSoup(html, "html.parser")
|
|
|
|
for data in soup(['style', 'script']):
|
|
# Remove tags
|
|
data.decompose()
|
|
|
|
# return data by retrieving the tag content
|
|
return ' '.join(soup.stripped_strings)
|