From c26454e02a884cf3c028d0360c374fe531154f9b Mon Sep 17 00:00:00 2001 From: scossa Date: Sun, 26 Nov 2023 19:15:55 +0100 Subject: [PATCH] Update scrapeje.py --- scrapeje.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/scrapeje.py b/scrapeje.py index fc44618..5bc5f22 100644 --- a/scrapeje.py +++ b/scrapeje.py @@ -15,7 +15,6 @@ nome=[] desc=[] npezzi=[] prezzo=[] -#prezzof=[] prezzoN=[] scripto=[] @@ -23,25 +22,25 @@ scripto=[] #INPUT #prende l url della pagina justeat del ristorante in input print ("\nesempio: https://www.justeat.it/restaurants-pizzeria-la-garganica-bologna/menu") -#restaurant_url = input('INSERISCI IL LINK DELLA PAGINA DEL RISTORANTE: ') +restaurant_url = input('INSERISCI IL LINK DELLA PAGINA DEL RISTORANTE: ') #PER DEBUG -restaurant_url = 'https://www.justeat.it/restaurants-pizzeria-la-garganica-bologna/menu' +#restaurant_url = 'https://www.justeat.it/restaurants-pizzeria-la-garganica-bologna/menu' #INIZIALLIZZO PARSER -# driver = webdriver.Chrome() -# driver.get(restaurant_url) +driver = webdriver.Chrome() +driver.get(restaurant_url) -# wait = WebDriverWait(driver, 10) -# wait.until(EC.presence_of_element_located((By.CLASS_NAME, "c-menuItems-price--offline"))) +wait = WebDriverWait(driver, 10) +wait.until(EC.presence_of_element_located((By.CLASS_NAME, "c-menuItems-price--offline"))) -# page = driver.page_source +page = driver.page_source -# with open('JEmenu.html', 'w') as f: -# f.write(page) +with open('JEmenu.html', 'w') as f: + f.write(page) -#apre e legge il file +apre e legge il file with open('JEmenu.html', 'r') as f: page = f.read() @@ -191,4 +190,4 @@ html += "" with open("pagina.html", "w") as file: file.write(html) -#os.remove("JEmenu.html") \ No newline at end of file +os.remove("JEmenu.html") \ No newline at end of file