viewing paste thrh rt | Text

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14
from bs4 import BeautifulSoup
 
html_content = """
<h2>we fweg wg ww</h2>
<p>g wr</p>
<p>gw gwrw <a href="erergeg.com">gwrgrw</a></p>
<p>&nbsp;gf wergerg erge</p>
"""
 
soup = BeautifulSoup(html_content, 'html.parser')
 
text = soup.get_text(separator=' ', strip=True)
print(text)
 
Viewed 54 times, submitted by jiyikap944.