i have a problem. I want to create a web scraping script that finds specific html tags from a website and give as a result the text inside the tags. The problem is that i cannot do that. It keeps giving me some html code and i cannot find specific html tags from the code i found earlier. Here is the code i have written:
from bs4 import BeautifulSoup as bs
import requests
url = "https://ec.europa.eu/info/strategy/priorities-2019-2024/european-green-deal_en"
page = requests.get(url).text
doc = bs(page, "html.parser")
h2 = doc.find_all("h2", id="latest")
h3 = h2.next_siblings
print(h3)
# print(list(h2[0].next_siblings))
I want to take the latest news from the europa.eu. What can i do in order to improve my code?