но склеивает все переносы строк
Привет! Попробуй так: # pip install bs4 from bs4 import BeautifulSoup html_text = """ <div class="zn-body__paragraph" data-paragraph-id="paragraph_22039D34-7F3A-6CFD-3C09-4F70518EA836"> In an open letter published in the Lancet medical journal, they argued that a rising number of Covid-19 cases, the new <a href="http://www.cnn.com/2021/07/30/health/delta-variant-covid-19-questions-answered/index.html" target="_blank">Delta variant</a> and the fact that a large part of the UK population was not yet fully vaccinated made the move too risky. </div> """ soup = BeautifulSoup(html_text, 'html.parser') raw_text = soup.get_text() print(raw_text)
Пандас умеет читать html
Обсуждают сегодня