This commit is contained in:
ada-dmitry
2023-05-20 14:52:34 +03:00
parent 2d743e743b
commit c0aafa1eb5
22 changed files with 12 additions and 4 deletions
+6
View File
@@ -0,0 +1,6 @@
{
"[python]": {
"editor.defaultFormatter": "ms-python.autopep8"
},
"python.formatting.provider": "none"
}
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1,5 +1,5 @@
hostname = "localhost" hostname = "localhost"
databname = "ada" databname = "ada"
username = "ada" username = "postgres"
passw = "Ri588856" passw = "Ri588856"
api = "6285042955:AAEPprYo9K7Ta0RkDcoqO2Z4Ejdw8to1NX0" api = "6285042955:AAEPprYo9K7Ta0RkDcoqO2Z4Ejdw8to1NX0"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

+5 -3
View File
@@ -14,15 +14,17 @@ try:
cursor.execute(creat_qwery) cursor.execute(creat_qwery)
connection.commit() connection.commit()
except psycopg2.errors.DuplicateTable: except psycopg2.errors.DuplicateTable:
print("s") print("")
for i in range(15): for i in range(15):
print(i)
url = 'https://amwine.ru' + \ url = 'https://amwine.ru' + \
parser.pictures[i].find('a').find('img').attrs['data-src'] parser.pictures[i].find('a').find('img').attrs['data-src']
filename = f"Python/TeleBot/image/{i}.jpg" filename = f"Python/TeleBot/image/{i}.jpg"
wget.download(url, filename) try:
img = open(filename)
except IOError as e:
wget.download(url, filename)
try: 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}')""" 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) cursor.execute(ins_qwery)