2024-09-26 16:46:26 +03:00

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)