diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index d63945e..28f4cba 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,9 +4,8 @@
-
+
-
@@ -36,39 +35,12 @@
- {
- "keyToString": {
- "last_opened_file_path": "C:/Users/rusta/c22712",
- "settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable"
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+}]]>
+
@@ -76,10 +48,9 @@
-
-
+
-
+
@@ -92,9 +63,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -143,12 +135,12 @@
1676934066947
-
- 1678906921509
+
+ 1679839777822
- 1678906921509
+ 1679839777822
@@ -170,14 +162,14 @@
-
-
+
file://$PROJECT_DIR$/main.py
+ 8
diff --git a/Задания/task1/Antipenko/DB1.py b/Задания/task1/Antipenko/DB1.py
index b790f81..1915673 100644
--- a/Задания/task1/Antipenko/DB1.py
+++ b/Задания/task1/Antipenko/DB1.py
@@ -28,7 +28,6 @@ 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"
- 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}')"""
cursor.execute(ins_qwery)
@@ -39,4 +38,4 @@ for i in range(15):
cursor.close()
-connection.close()
\ No newline at end of file
+connection.close()
diff --git a/Задания/task1/Epifanov/FHWDB.py b/Задания/task1/Epifanov/FHWDB.py
new file mode 100644
index 0000000..75f4a5b
--- /dev/null
+++ b/Задания/task1/Epifanov/FHWDB.py
@@ -0,0 +1,32 @@
+from bs4 import BeautifulSoup
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+import psycopg2
+import wget
+
+browser = webdriver.Chrome(service=Service('C:\Desktop\exe\chromedriver.exe'))
+browser.get('https://flawery.ru/moscow/bouquets/event-yanvary25/?min=0&max=max&sorting=discount&filter_24h=on')
+soup = BeautifulSoup(browser.page_source, "lxml")
+Name = soup.find_all(attrs={"class": "catalog_title"})
+Price = soup.find_all(attrs={"class": "catalog_price_now"})
+Delivery_Time = soup.find_all(attrs={"class": "catalog_express"})
+Discount = soup.find_all(attrs={"class": "catalog_sale"})
+Image = soup.find_all(attrs={"class": "catalog_item catalog_item_popup"})
+
+connection = psycopg2.connect(host='localhost', dbname='FHWDB', user='postgres', password='Q1w2e3r4')
+cursor = connection.cursor()
+create_q = '''CREATE TABLE Parse
+ (ID serial primary key, Name varchar(100), Price varchar(9), Delivery_Time varchar(25), Discount varchar(10), src varchar(110))'''
+cursor.execute(create_q)
+connection.commit()
+
+for j in range(60):
+ url = 'https://flawery.ru'+Image[j].find('a').find('picture').find('img').attrs['src']
+ tempf = f"C:\\Users\\user\\Desktop\\FHWDB{j}.jpg"
+ wget.download(url, tempf)
+ insert_query = f'''INSERT into public.Parse(Name, Price, Delivery_Time, Discount, src) values ('{Name[j].text}', '{Price[j].text}', '{Delivery_Time[j].text}', '{Discount[j].text}', '{tempf}') '''
+ cursor.execute(insert_query)
+
+connection.commit()
+cursor.close()
+connection.close()
diff --git a/Задания/task1/Gasanova/parser.py b/Задания/task1/Gasanova/parser.py
index a2f1561..1252676 100644
--- a/Задания/task1/Gasanova/parser.py
+++ b/Задания/task1/Gasanova/parser.py
@@ -1,4 +1,4 @@
-#made by dialuna (or just Diana Gasanova) <3
+# Diana Gasanova
import requests
from bs4 import BeautifulSoup as bs
URL = "https://www.kinopoisk.ru/lists/movies/top-250-2020/"
diff --git a/Задания/task1/Kluchinskaya1/parsing_in_bd.py b/Задания/task1/Kluchinskaya1/parsing_in_bd.py
new file mode 100644
index 0000000..79e2a72
--- /dev/null
+++ b/Задания/task1/Kluchinskaya1/parsing_in_bd.py
@@ -0,0 +1,26 @@
+from bs4 import BeautifulSoup
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+from wget import download
+import psycopg2
+connection = psycopg2.connect(host='localhost', dbname='dbdata',
+ user='postgres', password='Q1w2e3r4')
+cursor=connection.cursor()
+s = Service('C:\\Users\\Dasha\\Desktop\\Progect\\chromedriver.exe')
+browser = webdriver.Chrome(service=s)
+url = 'https://www.tretyakovgallery.ru/'
+browser.get(url)
+html_text=browser.page_source
+soup = BeautifulSoup(html_text, 'lxml')
+products = soup.find_all(attrs={"class": "building-item"})
+for i, product in enumerate(products):
+ link = product.find("img").attrs.get("src")
+ tag = product.find("strong")
+ if tag is not None:
+ download(url + link, f"img\\{i}.jpg")
+ cursor.execute(f"""INSERT INTO public.parsing(name, link)
+ VALUES
+ ( '{tag.text}', '{url + link}')""")
+connection.commit()
+cursor.close()
+connection.close()
diff --git a/Задания/task1/Lahin/postgres.py b/Задания/task1/Lahin/postgres.py
new file mode 100644
index 0000000..0ca1bb2
--- /dev/null
+++ b/Задания/task1/Lahin/postgres.py
@@ -0,0 +1,71 @@
+import psycopg2
+import wget
+from bs4 import BeautifulSoup
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+import time
+i = 1
+s = Service("С:\DATA\ChromeDriver\chromedriver.exe")
+browser = webdriver.Chrome(service=s)
+browser.get("https://www.mvideo.ru/noutbuki-planshety-komputery-8/noutbuki-118?from=under_search")
+height = browser.execute_script("return document.body.scrollHeight")
+time.sleep(4)
+while 900*i < height:
+ height = browser.execute_script("return document.body.scrollHeight")
+ browser.execute_script(f"window.scrollTo(0,{900*i})")
+ time.sleep(1)
+ i+=1
+html_text = browser.page_source
+soup = BeautifulSoup(html_text, 'lxml')
+productst = soup.find_all('a', class_="product-title__text")
+pricest = soup.find_all('span', class_="price__main-value")
+features = soup.find_all('ul', class_="product-feature-list product-feature-list--undefined")
+pictures = soup.find_all('img', class_="product-picture__img product-picture__img--list")
+products, prices, diagonals, resolutions, CPUs, RAMs, Graphics_controllers, Volumes = [],[],[],[],[],[],[],[]
+for i in range(len(productst)):
+ products.append(productst[i].text.strip())
+ prices.append(pricest[i].text.replace("\xa0", "").strip())
+for feature in features:
+ u = feature.text
+ diagonals.append(u[20:u.find("\"",20)+1])
+ resolutions.append(u[u.find("\"",20)+2:u.find(".", 23)+1])
+ CPUs.append(u[u.find("Процессор",20)+9:u.find("ГГц",20)+3].replace("\xa0",""))
+ RAMs.append(" ".join(u[u.find("(RAM)",20)+5:u.find("Графический контроллер")].split()))
+ Graphics_controllers.append(u[u.find("Графический контроллер")+22:u.rfind("Объем")-2])
+ Volumes.append(u[u.rfind("Объем")+6:].replace("\xa0", "").strip())
+for i in range(len(Volumes)):
+ u = Volumes[i]
+ if u.rfind("D")!=-1: Volumes[i] = u[:u.rfind("D")+1]+ " " + u[u.rfind("D")+1:]
+ else: Volumes[i] = u[:u.rfind("С")+1]+ " " + u[u.rfind("С")+1:]
+connection=psycopg2.connect(host='localhost', dbname='dbdata', user='postgres', password='Q1w2e3r4')
+cursor = connection.cursor()
+insert = """CREATE TABLE public.laptops(
+id serial primary key,
+product varchar(100),
+price varchar(15),
+diagonal varchar(5),
+resolution varchar(20),
+CPU varchar(50),
+RAM varchar(10),
+Graphics_Controller varchar(40),
+Volume varchar(25),
+src varchar(100)
+);
+"""
+cursor.execute(insert)
+connection.commit()
+for i in range(len(products)):
+ url = "https://"+pictures[i]['src']
+ filename = f"C:\DATA\Images\{i+1}.jpg"
+ wget.download(url, filename)
+ insert = f"""INSERT INTO public.laptops(
+ product, price, diagonal, resolution, CPU, RAM, Graphics_Controller, Volume, src)
+ VALUES
+ ('{products[i]}', '{prices[i]}', '{diagonals[i]}', '{resolutions[i]}', '{CPUs[i]}', '{RAMs[i]}', '{Graphics_controllers[i]}', '{Volumes[i]}', '{filename}');"""
+ cursor.execute(insert)
+ connection.commit()
+cursor.execute("select * from laptops")
+print("Результат", cursor.fetchall())
+cursor.close()
+connection.close()
+
diff --git a/Задания/task1/Lahin/postgresEasy.py b/Задания/task1/Lahin/postgresEasy.py
new file mode 100644
index 0000000..375b40d
--- /dev/null
+++ b/Задания/task1/Lahin/postgresEasy.py
@@ -0,0 +1,42 @@
+import psycopg2
+import wget
+from bs4 import BeautifulSoup
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+s = Service("С:\DATA\ChromeDriver\chromedriver.exe")
+browser = webdriver.Chrome(service=s)
+browser.get("https://online.metro-cc.ru/virtual/assortiment_rioba-4887?from=under_search&page=2")
+html_text = browser.page_source
+soup = BeautifulSoup(html_text, 'lxml')
+productst = soup.find_all('span', class_="product-card-name__text")
+pricest = soup.find_all('span', class_="product-price__sum-rubles")
+pictures = soup.find_all('img', class_="product-card-photo__image")
+connection=psycopg2.connect(host='localhost', dbname='dbdata', user='postgres', password='Q1w2e3r4')
+cursor = connection.cursor()
+products, prices = [], []
+for i in range(len(productst)):
+ products.append(productst[i].text.replace("\n", "").strip())
+ prices.append(pricest[i].text+" Р/шт")
+insert = """CREATE TABLE public.Chocolate(
+id serial primary key,
+product varchar(100),
+price varchar(25),
+src varchar(50)
+);
+"""
+cursor.execute(insert)
+connection.commit()
+for i in range(len(products)):
+ url = pictures[i]['src']
+ filename = f"C:\DATA\Images2\{i+1}.jpg"
+ wget.download(url, filename)
+ insert = f"""INSERT INTO public.Chocolate(
+ product, price, src)
+ VALUES
+ ('{products[i]}', '{prices[i]}', '{filename}');"""
+ cursor.execute(insert)
+ connection.commit()
+cursor.execute("select * from Chocolate")
+print("Результат", cursor.fetchall())
+cursor.close()
+connection.close()
diff --git a/Задания/task1/Sukhanov/DZ_PARSBD.py b/Задания/task1/Sukhanov/DZ_PARSBD.py
new file mode 100644
index 0000000..b472c2a
--- /dev/null
+++ b/Задания/task1/Sukhanov/DZ_PARSBD.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()
+
+cr_qwery = """ create table Parser
+ (id serial primary key, name varchar(100), sale varchar(30), price varchar(10), rate varchar(10), picture varchar(100))"""
+
+#cursor.execute(cr_qwery)
+connection.commit()
+
+driver = Service('D:\GOGdriver\chromedriver.exe')
+browser = webdriver.Chrome(service=driver)
+browser.get('https://www.perekrestok.ru/cat/promo/10')
+html_code = browser.page_source
+soup = BeautifulSoup(html_code, 'lxml')
+
+name = soup.find_all('div', class_="product-card__title")
+sale = soup.find_all('div', class_="sc-kYrlTI ciSrDA product-card__badge")
+price = soup.find_all('div', class_="price-new")
+rate = soup.find_all('div', class_="rating-value")
+picture = soup.find_all('div', class_="product-card__image-wrapper")
+
+for i in range(15):
+ url = picture[i].find('img').attrs['src']
+ filename = f"C:\\Users\\71332\PycharmProjects\pythonProject1\\venv\Pictures\{i}.jpg"
+ wget.download(url, filename)
+ ins_qwery = f"""insert into public.Parser(name, sale, price, rate, picture) values ('{name[i].text}', '{sale[i].text}', '{price[i].text}', '{rate[i].text}', '{filename}')"""
+ cursor.execute(ins_qwery)
+ connection.commit()
+
+
+
+
+cursor.close()
+
+connection.close()
\ No newline at end of file
diff --git a/Задания/task1/Sukhanov/zaparsil.py b/Задания/task1/Sukhanov/zaparsil.py
new file mode 100644
index 0000000..d985a6a
--- /dev/null
+++ b/Задания/task1/Sukhanov/zaparsil.py
@@ -0,0 +1,16 @@
+from bs4 import BeautifulSoup
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+
+driver = Service('D:\GOGdriver\chromedriver.exe')
+browser = webdriver.Chrome(service=driver)
+browser.get('https://www.kinopoisk.ru/lists/movies/popular-films/')
+html_code = browser.page_source
+soup = BeautifulSoup(html_code, 'lxml')
+name = soup.find_all('div', class_="desktop-list-main-info_secondaryTitleSlot__mc0mI")
+
+print(soup)
+print(name)
+
+for i in name:
+ print(i.text)
\ No newline at end of file
diff --git a/Задания/task1/nikitin/test2.py b/Задания/task1/nikitin/test2.py
index 553f156..23b8205 100644
--- a/Задания/task1/nikitin/test2.py
+++ b/Задания/task1/nikitin/test2.py
@@ -1,12 +1,42 @@
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
+import psycopg2
+import wget
+
+connection = psycopg2.connect(host='localhost', dbname='dbdata', user='postgres', password='Q1w2e3r4')
+cursor = connection.cursor()
+
s = Service('D:\Games\data\chromedriver.exe')
browser = webdriver.Chrome(service=s)
browser.get('https://www.volkswagen.ru/polo/')
html_text = browser.page_source
soup = BeautifulSoup(html_text, 'lxml')
+
+creat_table = """ create table Cars_volks
+ (id serial primary key, car_name varchar(20),
+ price varchar(15), adress varchar(300),
+ scr varchar(150)) """
+#cursor.execute(creat_table)
+connection.commit()
+
car_names = soup.find_all('div', class_='avn001-2_name')
prices = soup.find_all('div', class_='avn001-2_price-container')
-for car_name, price in zip(car_names, prices):
- print(f"Название машины:{car_name.text} | Цена: {price.text} рублей")
\ No newline at end of file
+adresses = soup.find_all('div', class_='avn001-2_dealer-link__text')
+pictures = soup.find_all('div', class_='avn001-2_image image__container')
+
+#for car_name, adress, price in zip(car_names, adresses, prices):
+# print(f"Название машины:{car_name.text} | Адрес диллера: {adress.text} | Цена: {price.text} рублей")
+
+for i in range(len(car_names)):
+ url = pictures[i].find('img').attrs['src']
+ filename = f"c22712\\Задания\\task1\\nikitin\\img\\{i}.jpg"
+# wget.download(url, filename) представим что картинки скачались:)
+
+ insert_qwery = f"""INSERT INTO public.Cars_volks(car_name, price, adress, scr)
+ VALUES ('{car_names[i].text}', '{prices[i].text}', '{adresses[i].text}', '{filename}')""";
+ cursor.execute(insert_qwery)
+ connection.commit()
+
+cursor.close()
+connection.close()
\ No newline at end of file
diff --git a/Задания/task1/romanov/num1 b/Задания/task1/romanov/num1
index 34ad16a..803d336 100644
--- a/Задания/task1/romanov/num1
+++ b/Задания/task1/romanov/num1
@@ -1 +1 @@
-def print_hi(' hello')
\ No newline at end of file
+абоба
\ No newline at end of file
diff --git a/Задания/task1/romanov/parcinghellride.py b/Задания/task1/romanov/parcinghellride.py
new file mode 100644
index 0000000..e36d091
--- /dev/null
+++ b/Задания/task1/romanov/parcinghellride.py
@@ -0,0 +1,14 @@
+from bs4 import BeautifulSoup
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+
+s = Service('C:\Desktop\exe\chromedriver.exe')
+browser = webdriver.Chrome(service=s)
+browser.get('https://www.hellride.ru/catalog/zapchasti-dlya-tryukovyh-samokatov/deki')
+html_text = browser.page_source
+soup = BeautifulSoup(html_text, 'lxml')
+prices = soup.find_all(attrs={"class": "product-card__price"})
+titles = soup.find_all(attrs={"class": "product-card__title"})
+
+for price, title in zip(prices, titles):
+ print(f" название {title.text} ; цена: {price.text}")
\ No newline at end of file