mirror of
https://github.com/ada-dmitry/PyProg_ada.git
synced 2026-09-24 01:10:40 +00:00
upt1
This commit is contained in:
+2
-2
@@ -7,7 +7,7 @@ import config
|
||||
|
||||
# Парсер и загрузчик в БД//Антипенко Дмитрий
|
||||
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()
|
||||
|
||||
@@ -33,7 +33,7 @@ pictures = b_soup.find_all('div', class_="catalog-list-item__img-wrapper")
|
||||
for i in range(15):
|
||||
url = 'https://amwine.ru' + \
|
||||
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)
|
||||
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}')"""
|
||||
|
||||
Reference in New Issue
Block a user