diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 28f4cba..858e631 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,7 @@
-
+
@@ -20,7 +20,7 @@
-
+
@@ -35,11 +35,11 @@
- {
+ "keyToString": {
+ "last_opened_file_path": "C:/Users/71332/PycharmProjects/c22712"
}
-}]]>
+}
@@ -169,7 +169,7 @@
file://$PROJECT_DIR$/main.py
- 8
+ 5
diff --git a/Задания/task1/Prokhorova/dz.py b/Задания/task1/Prokhorova/dz.py
new file mode 100644
index 0000000..3f21c6b
--- /dev/null
+++ b/Задания/task1/Prokhorova/dz.py
@@ -0,0 +1,41 @@
+import psycopg2
+import wget
+from bs4 import BeautifulSoup
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+connection = psycopg2.connect(host='localhost', dbname='dbdata', user='postgres', password='Q1w2e3r4')
+
+cursor = connection.cursor()
+
+create_table = """ create table dresses
+ (id serial primary key, name varchar(200), sale varchar(50), price varchar(50), info varchar(50), picture varchar(200))"""
+
+cursor.execute(create_table)
+connection.commit()
+
+driver = Service('D:\data\chromedriver.exe')
+browser = webdriver.Chrome(service=driver)
+browser.get('https://www.ozon.ru/category/platya-zhenskie-7502/')
+html_code = browser.page_source
+soup = BeautifulSoup(html_code, 'lxml')
+
+name = soup.find_all('span', class_="m2e e3m m3e m5e tsBodyL k7l l7k")
+sale = soup.find_all('div', class_="eg1 g3e")
+price = soup.find_all('span', class_="a2a-a2")
+info = soup.find_all('span', class_="je4")
+picture = soup.find_all('div', class_="k1m")
+
+for i in range(20):
+ url = picture[i].find('img').attrs['src']
+ file_name = f"C:\\Users\\Honor\\Desktop\\учеба\\прога\\pictures\\{i}.jpg"
+ wget.download(url, file_name)
+ ins_table = f"""insert into public.dresses(name, sale, price, info, picture) values ('{name[i].text}', '{sale[i].text}', '{price[i].text}', '{info[i].text}', '{file_name}')"""
+ cursor.execute(ins_table)
+ connection.commit()
+
+
+
+
+cursor.close()
+
+connection.close()
\ No newline at end of file