Пакет Beautiful Soup делает это немедленно для вас.
from bs4 import BeautifulSoup soup = BeautifulSoup(html) text = soup.get_text() print(text)