From 6437960ec835ece46528759b9ba75d7a63d8739e Mon Sep 17 00:00:00 2001 From: scossa Date: Tue, 28 Nov 2023 17:16:42 +0100 Subject: [PATCH] update --- scrapeje.py | 85 ++++++++++++++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 40 deletions(-) diff --git a/scrapeje.py b/scrapeje.py index a9a150a..149448a 100644 --- a/scrapeje.py +++ b/scrapeje.py @@ -278,7 +278,7 @@ if os.path.exists('rubrica.txt') and os.path.exists('./DATI_RUBRICA'): print( '\n', os.listdir('./DATI_RUBRICA'), '\n') scelta = input("Scegli un numero esistente o premi Enter per metterre un link: ") - #scelta = '0' + #scelta = '1' parserdarubrica() else: @@ -320,51 +320,56 @@ salvainrubrica() # print("\n" + "-" * 25 + "\n") -#DA RIFARE -# # Genera codice HTML -# html = "" -# html += "

" + nrist + "



" -# for x in range(len(nome)): -# html += "

" + nome[x] + "

" -# html += "

" + str(desc[x]) + "

" -# html += "

N. pezzi: " + str(npezzi[x]) + "

" -# html += "

Prezzo: " + str(prezzoN[x]) + "€

" -# html += "
" -# html += "

" +# DA RIFARE +# Genera codice HTML +html = "" +html += "

" + nrist + "



" +for x in range(len(nome)): + html += "

" + nome[x] + "

" + html += "

" + str(desc[x]) + "

" + html += "

N. pezzi: " + str(npezzi[x]) + "

" + html += "

Prezzo: " + str(prezzoN[x]) + "€

" + #html += "
" + html += "
" -# html += "

Prodotti aggiunti

" -# html += "
" -# html += '
Total: €0.00
' #VA MA NON SERVE, NON VA -# html += "" + +html += "" -# html += "" -# html += "" - - -# # Salvataggio su file -# with open("pagina.html", "w") as file: -# file.write(html) - +# Salva su file +with open("pagina.html", "w") as file: + file.write(html) +#FA SCHIFO +# html += ' var popup = window.open("", "Popup", "width=200,height=100,top=" + ((window.innerHeight - 100) / 2) + ",left=" + ((window.innerWidth - 200) / 2));' +# html += ' popup.document.write("

Prodotto aggiunto

");' +# html += ' setTimeout(function(){ popup.close(); }, 1000);' \ No newline at end of file