upt1
@@ -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}')"""
|
||||
|
||||
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 118 KiB |
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 95 KiB |
|
After Width: | Height: | Size: 95 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 97 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 79 KiB |
|
After Width: | Height: | Size: 120 KiB |
|
After Width: | Height: | Size: 126 KiB |