diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 28f4cba..4d658fb 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,9 +4,7 @@
-
-
-
+
@@ -20,7 +18,7 @@
-
+
@@ -37,7 +35,7 @@
@@ -142,7 +140,14 @@
1679839777822
-
+
+ 1680206771744
+
+
+
+ 1680206771744
+
+
@@ -162,14 +167,15 @@
-
+
+
file://$PROJECT_DIR$/main.py
- 8
+ 5
diff --git a/fars.py b/fars.py
new file mode 100644
index 0000000..7740187
--- /dev/null
+++ b/fars.py
@@ -0,0 +1,44 @@
+from bs4 import BeautifulSoup
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+from time import sleep
+import psycopg2
+s = Service("C:\Driver\chromedriver.exe")
+browser = webdriver.Chrome(service=s)
+browser.get("https://drivenew.ru/layfkhaki/besplatno/top-10-vinodelcheskikh-khozyaystv-krasnodarskogo-kraya/")
+sleep(1)
+html_text = browser.page_source
+soup = BeautifulSoup(html_text, "lxml")
+name = soup.find_all("h2")
+contacts = soup.find_all("div", class_="article-info")
+
+address = []
+number = []
+for element in contacts:
+ a = element.find_all("p")[1]
+ n = element.find_all("p")[2]
+ address.append(a)
+ number.append(n)
+
+pic = soup.find("div", class_="white-bg white-bg-text box-15-new").find_all("img")
+picture = []
+url = "https://drivenew.ru"
+for i in pic:
+ p = url + i.attrs.get("src")
+ picture.append(p)
+
+
+connection = psycopg2.connect(host='localhost', dbname='dbdata', user='postgres', password='Q1w2e3r4t5')
+cursor = connection.cursor()
+create = """create table Distilleries
+ (id serial primary key , Name varchar(100), Place varchar(200), Contacts varchar(100), ImageLink varchar(80));"""
+cursor.execute(create)
+connection.commit()
+for j in range(10):
+ qwery = f"insert into public.distilleries(Name, Place, Contacts, ImageLink) values('{name[j].text.strip()}', '{address[j].text.strip()}', '{number[j].text.strip()}', '{picture[j]}')"
+ cursor.execute(qwery)
+ connection.commit()
+cursor.execute('select * from Distilleries')
+print(cursor.fetchall())
+cursor.close()
+connection.close()
\ No newline at end of file
diff --git a/Задания/task1/Filcheva/bd.py b/Задания/task1/Filcheva/bd.py
new file mode 100644
index 0000000..edf9e9c
--- /dev/null
+++ b/Задания/task1/Filcheva/bd.py
@@ -0,0 +1,44 @@
+from bs4 import BeautifulSoup
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+from time import sleep
+import psycopg2
+s = Service("C:\Driver\chromedriver.exe")
+browser = webdriver.Chrome(service=s)
+browser.get("https://drivenew.ru/layfkhaki/besplatno/top-10-vinodelcheskikh-khozyaystv-krasnodarskogo-kraya/")
+sleep(1)
+html_text = browser.page_source
+soup = BeautifulSoup(html_text, "lxml")
+name = soup.find_all("h2")
+contacts = soup.find_all("div", class_="article-info")
+
+address = []
+number = []
+for element in contacts:
+ a = element.find_all("p")[1]
+ n = element.find_all("p")[2]
+ address.append(a)
+ number.append(n)
+
+pic = soup.find("div", class_="white-bg white-bg-text box-15-new").find_all("img")
+picture = []
+url = "https://drivenew.ru"
+for i in pic:
+ p = url + i.attrs.get("src")
+ picture.append(p)
+
+
+connection = psycopg2.connect(host='localhost', dbname='dbdata', user='postgres', password='Q1w2e3r4t5')
+cursor = connection.cursor()
+create = """create table Distilleries
+ (id serial primary key , Name varchar(100), Place varchar(200), Contacts varchar(100), ImageLink varchar(80));"""
+cursor.execute(create)
+connection.commit()
+for j in range(10):
+ qwery = f"insert into public.distilleries(Name, Place, Contacts, ImageLink) values('{name[j].text.strip()}', '{address[j].text.strip()}', '{number[j].text.strip()}', '{picture[j]}')"
+ cursor.execute(qwery)
+ connection.commit()
+cursor.execute('select * from Distilleries')
+print(cursor.fetchall())
+cursor.close()
+connection.close()
diff --git a/Задания/task1/Gasanova/laba b/Задания/task1/Gasanova/laba
deleted file mode 100644
index 980a0d5..0000000
--- a/Задания/task1/Gasanova/laba
+++ /dev/null
@@ -1 +0,0 @@
-Hello World!
diff --git a/Задания/task1/Gasanova/parser.py b/Задания/task1/Gasanova/parser.py
deleted file mode 100644
index 1252676..0000000
--- a/Задания/task1/Gasanova/parser.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Diana Gasanova
-import requests
-from bs4 import BeautifulSoup as bs
-URL = "https://www.kinopoisk.ru/lists/movies/top-250-2020/"
-r = requests.get(URL, timeout=10)
-soup = bs(r.text, "html.parser")
-films = soup.find_all(attrs={"class": "styles_mainTitle__IFQyZ styles_activeMovieTittle__kJdJj"})
-for film in films:
- print(film.text)
diff --git a/Задания/task1/Gasanova/penny.py b/Задания/task1/Gasanova/penny.py
new file mode 100644
index 0000000..686e539
--- /dev/null
+++ b/Задания/task1/Gasanova/penny.py
@@ -0,0 +1,29 @@
+# парсер к полусему 8 неделя
+from bs4 import BeautifulSoup
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+from wget import download
+import psycopg2 as psyc
+
+# s = Service("chromedriver") на Ubuntu можно не указывать путь до драйвера :)
+URL = "https://proskateshop.ru/skejtbordy/?utm_source=yandex&utm_medium=cpc&utm_campaign=cn%7Cskeyty_gz-1%7Ccid%7C51517250%7Csearch&utm_content=gid%7C4180310153%7Caid%7C8980588780%7C20506942844_20506942844%7Cmain&utm_term=%D0%9F%D0%B5%D0%BD%D0%BD%D0%B8%20%D0%B1%D0%BE%D1%80%D0%B4%20%D0%BA%D1%83%D0%BF%D0%B8%D1%82%D1%8C&etext=2202.N39xvihj0F0Od_d4etv_6nh36sdlRP-T26wHLuCJfjo_JZtVI5O7HY5f8FOJnzuLZXB6eWZoZnp2dG1laHBlcA.aceac50a24e4832d82874cd59ca1f9a315d9b351&_openstat=ZGlyZWN0LnlhbmRleC5ydTs1MTUxNzI1MDs4OTgwNTg4NzgwO3lhbmRleC5ydTpndWFyYW50ZWU&yclid=1445113833197462400"
+brow = webdriver.Chrome()
+brow.get(URL)
+
+html = brow.page_source
+
+soup = BeautifulSoup(html, "lxml")
+
+penny = soup.find_all(attrs={"class": "product-layout product-grid col-lg-4 col-md-4 col-sm-6 col-xs-6"})
+
+with psyc.connect(dbname="db_for_parse", user="dialuna") as conn:
+ with conn.cursor() as cursor:
+ for i, product in enumerate(penny[1:]):
+ image_link = product.find("img").attrs.get("src")
+ image_name = product.find("img").attrs.get("alt")
+ price = product.find("p", attrs={"class": "price"}).text.strip()
+
+ cursor.execute(f"""insert into test(link, name, price, file)
+ values ('{image_link}', '{image_name}', '{price}', 'images/{i}.jpg')""")
+
+ conn.commit()
diff --git a/Задания/task1/Kuranova/parsing пивоварни.py b/Задания/task1/Kuranova/parsing пивоварни.py
new file mode 100644
index 0000000..871dff7
--- /dev/null
+++ b/Задания/task1/Kuranova/parsing пивоварни.py
@@ -0,0 +1,43 @@
+from bs4 import BeautifulSoup
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+import psycopg2
+from time import sleep
+s = Service("C:\data\chromedriver.exe")
+browser = webdriver.Chrome(service=s)
+browser.get('https://untappd.com/brewery/top_rated')
+sleep(1)
+html_text=browser.page_source
+soup = BeautifulSoup(html_text, 'lxml')
+ratings = soup.find_all('div', class_='beer-item')
+item = []
+for i in ratings:
+ c = i.text
+ c = c.split('\n')
+ for k in c:
+ if k == '':
+ c.pop(c.index(k))
+ d = i.find('img').get('src')
+ c.append(d)
+ item.append(c)
+item.pop(3)
+item.pop(8)
+
+
+connection = psycopg2.connect(host='localhost', dbname='breweries', user='postgres', password='Q1w2e3r4t5')
+cursor=connection.cursor()
+create = """ create table Information
+ (id primary key int, Name varchar(100), Place varchar(150), Sorts varchar(15), AmountOfRatings varchar(25),
+ Rating varchar(10), ImageLink varchar(150));"""
+cursor.execute(create)
+connection.commit()
+for i in range(20):
+ insert_qwery="""INSERT INTO public.Information(id,Name, Place, Sorts, AmountOfRatings, Rating, ImageLink) VALUES
+ ( '"""+str(i+1)+"""', '"""+item[i][0]+"""', '"""+item[i][1]+"""', '"""+item[i][2]+"""', '"""+item[i][3]+"""',
+ '"""+item[i][9]+"""', '"""+item[i][13]+"""');""";
+ cursor.execute(insert_qwery)
+ connection.commit()
+cursor.execute('select * from Information')
+print(cursor.fetchall())
+cursor.close()
+connection.close()
\ No newline at end of file
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
diff --git a/Задания/task1/Prokhorova/pars.py b/Задания/task1/Prokhorova/pars.py
new file mode 100644
index 0000000..6732d15
--- /dev/null
+++ b/Задания/task1/Prokhorova/pars.py
@@ -0,0 +1,15 @@
+from bs4 import BeautifulSoup
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+
+s = Service('D:\data\chromedriver.exe')
+browser = webdriver.Chrome(service=s)
+browser.get('https://www.kfc.ru/')
+html_text = browser.page_source
+soup = BeautifulSoup(html_text, 'lxml')
+
+prices = soup.find_all(attrs={"class": "GFmMCzZoYv"})
+titles = soup.find_all(attrs={"class": "_14ZQf5wtqx c-description"})
+
+for price, title in zip(prices, titles):
+ print(f" название {title.text} ; цена: {price.text}")
\ No newline at end of file
diff --git a/Задания/task1/Samigullin/test1.py b/Задания/task1/Samigullin/test1.py
new file mode 100644
index 0000000..c834943
--- /dev/null
+++ b/Задания/task1/Samigullin/test1.py
@@ -0,0 +1,15 @@
+from bs4 import BeautifulSoup
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+import time
+
+s = Service('C:/Users/rusta/OneDrive/Рабочий стол/ИНФА/инфа 2 сем/driver/chromedriver.exe')
+browser = webdriver.Chrome(service=s)
+browser.get('https://lafoy.ru/modnye-muzhskie-strizhki-2023-3052/')
+time.sleep (10)
+html_text = browser.page_source
+soup = BeautifulSoup(html_text, 'lxml')
+haircuts = soup.find_all('h2', class_='tm8 post__title')
+
+for i in range(0, 30):
+ print(haircuts[i].text)
diff --git a/Задания/task1/romanov/bd b/Задания/task1/romanov/bd
index fb0c1b1..7f5d9c1 100644
--- a/Задания/task1/romanov/bd
+++ b/Задания/task1/romanov/bd
@@ -8,7 +8,7 @@ connection = psycopg2.connect(host='localhost', dbname='postgres',
cursor = connection.cursor()
-cr_qwery = """ create table avito
+cr_qwery = """ create table parser
(id serial primary key,
name varchar(60),
price varchar(15),
@@ -17,8 +17,8 @@ cr_qwery = """ create table avito
cursor.execute(cr_qwery)
connection.commit()
-driver = Service('C:\Desktop\exe\chromedriver.exe')
-browser = webdriver.Chrome(service=driver)
+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_code = browser.page_source
soup = BeautifulSoup(html_code, 'lxml')
@@ -26,9 +26,10 @@ soup = BeautifulSoup(html_code, 'lxml')
name = soup.find_all('span', class_='product-card__title')
price = soup.find_all('span', class_='product-card__price')
picture = soup.find_all('img', class_='product-slider__slide-img swiper-lazy swiper-lazy-loaded')
-
+#for prices, names in zip(price, name,):
+ #print(f" название {names.text} ; цена: {prices.text} ")
for i in range(len(name)):
- url = picture[i].find('img').attrs['src']
+ url = picture[i].attrs['src']
filename = f"C:\\Users\\Михаил\PycharmProjects\pythonProject8\\venv\Pictures\{i}.jpg"
wget.download(url, filename)
ins_qwery = f"""insert into public.Parser(name, price, picture)