Загрузка данных


import re
import requests

url = "https://lenta.ru/"
html = requests.get(url, headers={"User-Agent": "Mozilla/5.0"}).text

h1 = re.findall(r"<h1[^>]*>(.*?)</h1>", html, flags=re.I | re.S)
h2 = re.findall(r"<h2[^>]*>(.*?)</h2>", html, flags=re.I | re.S)
h3 = re.findall(r"<h3[^>]*>(.*?)</h3>", html, flags=re.I | re.S)

titles = h1 + h2 + h3
titles = [re.sub(r"<[^>]+>", "", t).strip() for t in titles]
titles = [t for t in titles if re.search(r"Россия", t, flags=re.I)]

print(titles)