# credit to the Stack Overflow user in the source link from bs4 import BeautifulSoup soup = BeautifulSoup(html) text = soup.get_text() print(text)