meow
@@ -1,5 +1,5 @@
|
||||
hostname = "localhost"
|
||||
databname = "ada"
|
||||
username = "ada"
|
||||
username = "postgres"
|
||||
passw = "Ri588856"
|
||||
api = "6285042955:AAEPprYo9K7Ta0RkDcoqO2Z4Ejdw8to1NX0"
|
||||
|
Before Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 118 KiB |
|
Before Width: | Height: | Size: 206 KiB |
|
Before Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 32 KiB |
@@ -14,15 +14,17 @@ try:
|
||||
cursor.execute(creat_qwery)
|
||||
connection.commit()
|
||||
except psycopg2.errors.DuplicateTable:
|
||||
print("s")
|
||||
print("")
|
||||
|
||||
|
||||
for i in range(15):
|
||||
print(i)
|
||||
url = 'https://amwine.ru' + \
|
||||
parser.pictures[i].find('a').find('img').attrs['data-src']
|
||||
filename = f"Python/TeleBot/image/{i}.jpg"
|
||||
wget.download(url, filename)
|
||||
try:
|
||||
img = open(filename)
|
||||
except IOError as e:
|
||||
wget.download(url, filename)
|
||||
try:
|
||||
ins_qwery = f"""insert into public.Parser(page_name, price, priceDis, mark, scr) values ('{parser.name[i].text}', '{parser.price[i].text}', '{parser.priceDis[i].text}', '{parser.mark[i].text}', '{filename}')"""
|
||||
cursor.execute(ins_qwery)
|
||||
|
||||