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