Python/BeautifulSoup - how to remove all tags from an element?

The Solution to Python/BeautifulSoup - how to remove all tags from an element? is


With BeautifulStoneSoup gone in bs4, it's even simpler in Python3

from bs4 import BeautifulSoup

soup = BeautifulSoup(html)
text = soup.get_text()
print(text)

~ Answered on 2015-01-27 02:47:02


Most Viewed Questions: