update
This commit is contained in:
1
pagina.html
Normal file
1
pagina.html
Normal file
File diff suppressed because one or more lines are too long
@@ -1,4 +1,5 @@
|
||||
import re
|
||||
import os
|
||||
from bs4 import BeautifulSoup
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.support.ui import WebDriverWait
|
||||
@@ -20,10 +21,11 @@ scripto=[]
|
||||
|
||||
#INPUT
|
||||
#prende l url della pagina justeat del ristorante in input
|
||||
#restaurant_url = input('link della pagina justeat del ristorante: ')
|
||||
print ("\nesempio: https://www.justeat.it/restaurants-pizzeria-la-garganica-bologna/menu")
|
||||
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
|
||||
@@ -169,3 +171,5 @@ html += "</body></html>"
|
||||
# Salvataggio su file
|
||||
with open("pagina.html", "w") as file:
|
||||
file.write(html)
|
||||
|
||||
os.remove("JEmenu.html")
|
||||
10
setup.sh
10
setup.sh
@@ -1,7 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Installo i moduli python necessari nella cartella .venv"
|
||||
python -m venv .venv
|
||||
source .venv/bin/activate
|
||||
echo
|
||||
|
||||
pip3 install requests
|
||||
pip3 install BeautifulSoup4
|
||||
@@ -12,6 +14,14 @@ pip3 install selenium
|
||||
#pip3 install cloudscraper
|
||||
#pip3 install json
|
||||
|
||||
echo "Installo chromium (se non già installato) necessario per lo scrape"
|
||||
echo
|
||||
sudo apt update
|
||||
if [ -f /etc/os-release ] && grep -q "NAME=\"Ubuntu\"" /etc/os-release; then
|
||||
sudo apt install chromium-browser -y
|
||||
else
|
||||
sudo apt install chromium -y
|
||||
fi
|
||||
echo
|
||||
echo "Attiva il virtualenv: source .venv/bin/activate"
|
||||
echo "Poi lancia lo script: python3 scrapeje.py"
|
||||
|
||||
Reference in New Issue
Block a user