Да, это странно. Мне придется взглянуть на теги более внимательно, так как я собираюсь отступить, но только в качестве первого шага (поэтому не самый красноречивый или эффективный), но вы можете получить этот первый тег, а затем начать искать эти следующие <p>
тегов, поместите их в список, затем объедините их, чтобы получить полный вывод:
import requests
import bs4
headers={'User-Agent': 'Mozilla/4.61 [en] (Win32; Escape 4.8; U)'}
url = 'https://southafricatoday.net/world-news/europe/damage-to-insured-property-during-yellow-vests-protests-soars-to-over-220mln/'
response = requests.get(url, headers=headers)
soup = bs4.BeautifulSoup(response.text, 'html.parser')
productDivs = soup.find_all('div', {'class':'td-post-content'})
article = ' '.join([ each.text.strip() for each in productDivs[0].find_next('p').find_next('p').parent.find_all('p') ])
Выход:
print (article)
On Monday, the French Insurance Federation (FFA) reported 170 million euros in losses, however, this figure did not include losses caused by protests that took place on 16 March that were accompanied by serious disorder in the country. The newspaper Figaro reported that on Tuesday, Le Maire announced during hearings in the country’s parliament that overall losses, including from Saturday’s unrest, amounted to 200 million euros. READ MORE: France’s New Bid to Suppress Yellow Vest Protests Likely to ‘Help the Movement’ The wave of the yellow vests rallies — named after the obligatory attribute of French drivers — started in France in mid-November. The protests have been marked by violence and public disorder. While the French government ultimately abandoned plans to raise the fuel taxes that triggered the rallies in the first place, and introduced other measures to improve the country’s socioeconomic situation, the protests have continued and morphed into a broader movement against French President Emmanuel Macron’s economic policies and high living costs. Sputnik News
South Africa Today – World News – Europe Join our mailing list to receive news every day Your email is safe with us. We hate spam too!