from bs4 import BeautifulSoup def extract_text(html_doc:str): return BeautifulSoup(html_doc , "html.parser").get_text().strip()