Scrivi un programma Python per recuperare le prime 5 notizie da una pagina di notizie data.
URL: https://www.nytimes.com/ would be translated to Italian as 'URL: https://www.nytimes.com/' (since it is an internet address and does not require translation).
import requests
from bs4 import BeautifulSoup

# Specifica l'URL
url = 'https://www.nytimes.com/'

# Fai la richiesta
response = requests.get(url)

# Analizza il contenuto html
soup = BeautifulSoup(response.content, 'html.parser')

# Trova tutti i titoli
headlines = soup.find_all('h2', class_='esl82me0')

# Stampa i primi 5 titoli
print('Primi 5 titoli dal New York Times:')
for head in headlines[:5]:
    print(head.text)