This commit is contained in:
ada-dmitry
2023-04-08 13:17:30 +03:00
parent 0519d86f50
commit 7206df1883
17 changed files with 2 additions and 2 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ import config
# Парсер и загрузчик в БД//Антипенко Дмитрий # Парсер и загрузчик в БД//Антипенко Дмитрий
connection = psycopg2.connect( connection = psycopg2.connect(
host=hostname, dbname=databname, user=username, password=passw) host=config.hostname, dbname=config.databname, user=config.username, password=config.passw)
cursor = connection.cursor() cursor = connection.cursor()
@@ -33,7 +33,7 @@ pictures = b_soup.find_all('div', class_="catalog-list-item__img-wrapper")
for i in range(15): for i in range(15):
url = 'https://amwine.ru' + \ url = 'https://amwine.ru' + \
pictures[i].find('a').find('img').attrs['data-src'] pictures[i].find('a').find('img').attrs['data-src']
filename = f"Programming\\23.03\img\{i}.jpg" filename = f"Python\\23.03\img\{i}.jpg"
print(filename) print(filename)
wget.download(url, filename) wget.download(url, filename)
ins_qwery = f"""insert into public.Parser(page_name, price, priceDis, mark, scr) values ('{name[i].text}', '{price[i].text}', '{priceDis[i].text}', '{mark[i].text}', '{filename}')""" ins_qwery = f"""insert into public.Parser(page_name, price, priceDis, mark, scr) values ('{name[i].text}', '{price[i].text}', '{priceDis[i].text}', '{mark[i].text}', '{filename}')"""
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB