import requests from bs4 import BeautifulSoup import cloudscraper nome=[] desc=[] npezzi=[] prezzo=[] n=0 #prende l url della pagina justeat del ristorante in input linkJE = input('link della pagina justeat del ristorante: ') #scrape html scraper = cloudscraper.create_scraper(browser={'browser': 'firefox','platform': 'windows','mobile': False}) page = scraper.get(linkJE).content #crea il file html with open('aleppo.html', 'wb') as f: f.write(page) #apre e legge il file with open('aleppo.html', 'rb') as f: page = f.read() #parser soup = BeautifulSoup(page, "html.parser") menu = soup.find(attrs={"data-test-id": "menu-item"}) #Stora nome ristorante nrist=soup.title.text[8:-32] menu.find(attrs={"allergenPhoneNumber": "menu-item-name"}) ## #Stora il numero di telfono del ristorante #info-> alla riga 870 dell html, all interno di uno