mirror of
https://github.com/KUlishevgeniy/c22712.git
synced 2026-09-23 23:50:21 +00:00
Телеграм Бот и Функции с ошибками
This commit is contained in:
@@ -49,12 +49,15 @@ for i in range(len(productst)):
|
||||
u.append(features[10*i+j].text)
|
||||
wget.download(url, filename)
|
||||
t = pricest[i].text.replace("\xa0", " ")
|
||||
insert = f"""INSERT INTO public.laptops(
|
||||
Product, Price, Diagonal, Resolution, CPU, RAM, Graphics_Controller, Volume, src)
|
||||
VALUES
|
||||
('{productst[i].text.strip()}', '{t.strip()}', '{u[0][:u[0].find("/")]}', '{u[0][u[0].find("/")+1:]}',
|
||||
'{u[2]}', '{u[4]+" "+u[5]}', '{u[6]}', '{u[8]}', '{filename}');"""
|
||||
cursor.execute(insert)
|
||||
connection.commit()
|
||||
try:
|
||||
insert = f"""INSERT INTO public.laptops(
|
||||
Product, Price, Diagonal, Resolution, CPU, RAM, Graphics_Controller, Volume, src)
|
||||
VALUES
|
||||
('{productst[i].text.strip()}', '{t.strip()}', '{u[0][:u[0].find("/")]}', '{u[0][u[0].find("/")+1:]}',
|
||||
'{u[2]}', '{u[4]+" "+u[5]}', '{u[6]}', '{u[8]}', '{filename}');"""
|
||||
cursor.execute(insert)
|
||||
connection.commit()
|
||||
except:
|
||||
connection.rollback()
|
||||
cursor.close()
|
||||
connection.close()
|
||||
Reference in New Issue
Block a user