diff --git a/.idea/misc.xml b/.idea/misc.xml
index d56657a..a971a2c 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 58a49ff..de61904 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,10 +4,7 @@
-
-
-
-
+
@@ -25,6 +22,7 @@
+
@@ -35,11 +33,6 @@
-
-
-
-
-
@@ -109,21 +102,7 @@
1676934066947
-
- 1677183215124
-
-
-
- 1677183215124
-
-
- 1677183242833
-
-
-
- 1677183242833
-
-
+
@@ -139,14 +118,11 @@
-
-
-
-
+
diff --git a/main.py b/main.py
index 5596b44..240a554 100644
--- a/main.py
+++ b/main.py
@@ -1,16 +1,23 @@
-# This is a sample Python script.
+from bs4 import BeautifulSoup
+from selenium.webdriver import Chrome
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+import time
-# Press Shift+F10 to execute it or replace it with your code.
-# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
+# Selenium - библиотека для автоматизации действий веб браузера, скрапинга
+# запускаем браузер
+s = Service('C:\data\chrome\chromedriver.exe')
+browser = webdriver.Chrome(service=s)
+browser.get('https://www.wildberries.ru/catalog/muzhchinam/odezhda/futbolki-i-mayki?bid=3b73ce5a-8eba-45a1-b9b2-0723f7592eac#c145658286')
+time.sleep (10)#задержка для ввода капчи
+html_text = browser.page_source
+soup = BeautifulSoup(html_text, 'lxml')
+films=soup.find_all('div', class_='/games/the-elder-scrolls-v-skyrim/')
+ratings = soup.find_all('div', class_='KnbCardMark_label__hg6Pg tv-series-mark KnbCardMark_isGreen__G_FLl')
+for film, rating in zip(films, ratings):
+ print(f"Игра:{film.text} | Рейтинг:{rating.text}")
-def print_hi(name):
- # Use a breakpoint in the code line below to debug your script.
- print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint.
-
-
-# Press the green button in the gutter to run the script.
-if __name__ == '__main__':
- print_hi('PyCharm')
-
-# See PyCharm help at https://www.jetbrains.com/help/pycharm/
+# Это пример парсинга. Вам необходимо спарсить 1 страницу каталога любого сайта на выбор.
+#сайты не должны повторяться
+# Спарсить необходимо только Заголовки и описание.
\ No newline at end of file
diff --git a/venv/task 1/task1.py b/venv/task 1/task1.py
deleted file mode 100644
index b1b2c86..0000000
--- a/venv/task 1/task1.py
+++ /dev/null
@@ -1 +0,0 @@
-Тестовый вап
\ No newline at end of file
diff --git a/Задания/task1/Antipenko/DB1.py b/Задания/task1/Antipenko/DB1.py
new file mode 100644
index 0000000..b790f81
--- /dev/null
+++ b/Задания/task1/Antipenko/DB1.py
@@ -0,0 +1,42 @@
+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='PythonDB', user='postgres', password='Q1w2e3r4')
+
+cursor = connection.cursor()
+
+creat_qwery = """ create table Parser
+ (id serial primary key, page_name varchar(100), price varchar(10), priceDis varchar(30), mark varchar(10), scr varchar(100))"""
+
+cursor.execute(creat_qwery)
+connection.commit()
+
+driver = Service('D:\teach\Prog\chromedriver.exe')
+browser = webdriver.Chrome(service=driver)
+browser.get('https://amwine.ru/catalog/igristoe_vino_i_shampanskoe/igristoe_vino/')
+html_code = browser.page_source
+b_soup = BeautifulSoup(html_code, 'lxml')
+name = b_soup.find_all('a', class_="catalog-list-item__title js-product-detail-link")
+price = b_soup.find_all('span', class_="middle_price")
+priceDis = b_soup.find_all('span', class_="baseoldprice")
+mark = b_soup.find_all('span', class_="product-rating__rating")
+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)
+ connection.commit()
+
+
+
+
+cursor.close()
+
+connection.close()
\ No newline at end of file
diff --git a/Задания/task1/Antipenko/ada.main.py b/Задания/task1/Antipenko/ada.main.py
index 251ea80..d0d6ed9 100644
--- a/Задания/task1/Antipenko/ada.main.py
+++ b/Задания/task1/Antipenko/ada.main.py
@@ -1,3 +1,6 @@
+
+#Вариант с пары
+'''
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
@@ -10,9 +13,27 @@ html_text = browser.page_source
time.sleep(20)
soup = BeautifulSoup(html_text, 'lxml')
films = soup.find_all('div', class_='base-movie-main-info_mainInfo__ZL_u3')
-'''
+
print(soup)
print(films)
-'''
+
for film in films:
print(film.text)
+'''
+#Домашка
+from bs4 import BeautifulSoup
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+
+driver = Service('D:\teach\Prog\chromedriver.exe')
+browser = webdriver.Chrome(service=driver)
+browser.get('https://hmbrussia.ru/regional-office/')
+html_code = browser.page_source
+b_soup = BeautifulSoup(html_code, 'lxml')
+name = b_soup.find_all('div', class_="ps-xl-3 ms-xl-3")
+
+print(b_soup)
+print(name)
+
+for i in name:
+ print(i.text)
diff --git a/Задания/task1/Epifanov/1-sq.py b/Задания/task1/Epifanov/1 - st hw.py
similarity index 65%
rename from Задания/task1/Epifanov/1-sq.py
rename to Задания/task1/Epifanov/1 - st hw.py
index 7c3826a..cb80d35 100644
--- a/Задания/task1/Epifanov/1-sq.py
+++ b/Задания/task1/Epifanov/1 - st hw.py
@@ -8,6 +8,7 @@ browser.get('https://www.rftoday.ru/_vse_zagolovki2')
html_text = browser.page_source
soup = BeautifulSoup(html_text, 'lxml')
infos = soup.find_all(attrs={"class": "title"})
+revs = soup.find_all(attrs={"class": "source"})
#print(infos[0].text) - если нужно вывести только n-ый заголовок
-for info in infos:
- print(info.text)#Вывод всех заголовков новостей страницы 1
+for info, rev in zip(infos, revs):
+ print(f"{info.text} ; Источник: {rev.text}")#Вывод всех заголовков новостей и их источников со страницы 1
\ No newline at end of file
diff --git a/Задания/task1/Filcheva/Verst1.py b/Задания/task1/Filcheva/Verst1.py
new file mode 100644
index 0000000..2000c61
--- /dev/null
+++ b/Задания/task1/Filcheva/Verst1.py
@@ -0,0 +1,12 @@
+from bs4 import BeautifulSoup
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+from time import sleep
+s = Service("C:\Driver\chromedriver.exe")
+browser = webdriver.Chrome(service=s)
+browser.get("https://mephi.ru/")
+sleep(10)
+html_text = browser.page_source
+soup = BeautifulSoup(html_text, "lxml")
+serv = soup.find_all("div", class_="views-field views-field-title menu-item menu-item-10702")
+print(serv[0].text)
diff --git a/Задания/task1/Garanyan/main.py b/Задания/task1/Garanyan/main.py
index 5cf8376..ac6f8f2 100644
--- a/Задания/task1/Garanyan/main.py
+++ b/Задания/task1/Garanyan/main.py
@@ -4,9 +4,9 @@ from selenium.webdriver.chrome.service import Service
s = Service("E:\data\chromedriver.exe")
browser = webdriver.Chrome(service=s)
-browser.get("https://www.litres.ru/fedor-dostoevskiy/prestuplenie-i-nakazanie/")
+browser.get("https://ria.ru/")
html_text = browser.page_source
soup = BeautifulSoup(html_text, 'lxml')
-books = soup.find_all('div', class_='biblio_book_descr')
-for book in books:
- print(book.text)
+news = soup.find_all('div', class_='cell cell-list')
+for new in news:
+ print(new.text)
diff --git a/Задания/task1/Kuznetsov/parcing.py b/Задания/task1/Kuznetsov/parcing.py
new file mode 100644
index 0000000..0227481
--- /dev/null
+++ b/Задания/task1/Kuznetsov/parcing.py
@@ -0,0 +1,15 @@
+from bs4 import BeautifulSoup
+from selenium.webdriver import Chrome
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+import time
+s = Service('E:\\Downloads\\chromedriver_win32.zip\\chromedriver.exe')
+browser = webdriver.Chrome(service=s)
+browser.get('https://trial-sport.ru/gds.php?s=51516&c1=1070639&c2=1070640')
+html_text = browser.page_source
+soup = BeautifulSoup(html_text, 'lxml')
+product_name=soup.find_all('a', class_='title')
+description=soup.find_all('span', class_='description')
+for product_name, description in zip(product_name, description):
+ print(f"Продукт: {product_name.text} \nОписание: {description.text}")
+print(" ")
diff --git a/Задания/task1/Kuznetsov/test b/Задания/task1/Kuznetsov/test
index 9daeafb..863b3de 100644
--- a/Задания/task1/Kuznetsov/test
+++ b/Задания/task1/Kuznetsov/test
@@ -1 +1,14 @@
-test
+from bs4 import BeautifulSoup
+from selenium.webdriver import Chrome
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+import time
+s = Service('E:\\Downloads\\chromedriver_win32.zip\\chromedriver.exe')
+browser = webdriver.Chrome(service=s)
+browser.get('https://trial-sport.ru/gds.php?s=51516&c1=1070639&c2=1070640')
+html_text = browser.page_source
+soup = BeautifulSoup(html_text, 'lxml')
+bike_name=soup.find_all('a', class_='title')
+print (bike_name[0].text)
+description=soup.find_all('span', class_='description')
+print (description[0].text)
diff --git a/Задания/task1/Lahin/parsing.py b/Задания/task1/Lahin/parsing.py
index 42c83eb..31c95f4 100644
--- a/Задания/task1/Lahin/parsing.py
+++ b/Задания/task1/Lahin/parsing.py
@@ -1,14 +1,14 @@
+
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
-from time import sleep
s = Service("С:\DATA\ChromeDriver\chromedriver.exe")
browser = webdriver.Chrome(service=s)
-browser.get("https://www.kinopoisk.ru/lists/movies/top250/")
-sleep(15)
+browser.get("https://online.metro-cc.ru/category/sladosti-chipsy-sneki/shokolad-batonchiki?from=under_search&is_action=1")
html_text = browser.page_source
soup = BeautifulSoup(html_text, 'lxml')
-films = soup.find_all('div', class_="desktop-list-main-info_secondaryTitleSlot__mc0mI")
-for film in films:
- print(film.text)
- print("--------")
+products = soup.find_all('a', class_="product-card-name reset-link catalog-2-level-product-card__name style--catalog-2-level-product-card")
+prices = soup.find_all('span', class_="product-card-prices__actual color-red")
+for product,price in zip(products, prices):
+ print(f"Продукт: {product.text[3:]}Цена: {price.text}")
+ print("-"*100)
\ No newline at end of file
diff --git a/Задания/task1/Samigullin/1page1win.py b/Задания/task1/Samigullin/1page1win.py
new file mode 100644
index 0000000..1d389aa
--- /dev/null
+++ b/Задания/task1/Samigullin/1page1win.py
@@ -0,0 +1,856 @@
+Python 3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)] on win32
+Type "help", "copyright", "credits" or "license()" for more information.
+from bs4 import BeautifulSoup
+from selenium.webdriver import Chrome
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+import time
+s = Service('C:\Users\rusta\OneDrive\Рабочий стол\драйвер\chromedriver.exe')
+SyntaxError: incomplete input
+s = Service('C:/Users/rusta/OneDrive/Рабочий стол/драйвер/chromedriver.exe')
+browser = webdriver.Chrome(service=s)
+browser.get('https://1whis.pro/bets/prematch/18/117/4406/11187162')
+html_text = browser.page_source
+soup = BeautifulSoup(html_text, 'lxml')
+stavka=soup.find_all('span', class_='odd-coefficient')
+print (films[0].text)
+Traceback (most recent call last):
+ File "", line 1, in
+ print (films[0].text)
+NameError: name 'films' is not defined
+print (stavka[0].text)
+Traceback (most recent call last):
+ File "", line 1, in
+ print (stavka[0].text)
+IndexError: list index out of range
+stavka=soup.find_all('span data-v-490bec7b', class_='odd-coefficient')
+print (stavka[0].text)
+Traceback (most recent call last):
+ File "", line 1, in
+ print (stavka[0].text)
+IndexError: list index out of range
+print(stavka[0])
+Traceback (most recent call last):
+ File "", line 1, in
+ print(stavka[0])
+IndexError: list index out of range
+print(stavka)
+[]
+stavka=soup.find_all('li data-v-f9d6adfa', class_='odds-item')
+print(stavka)
+[]
+print(stavka.text)
+Traceback (most recent call last):
+ File "", line 1, in
+ print(stavka.text)
+ File "C:\Users\rusta\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\element.py", line 2308, in __getattr__
+ raise AttributeError(
+AttributeError: ResultSet object has no attribute 'text'. You're probably treating a list of elements like a single element. Did you call find_all() when you meant to call find()?
+stavki=soup.find_all('span', class_='odd-coefficient')
+print(stavki.text)
+Traceback (most recent call last):
+ File "", line 1, in
+ print(stavki.text)
+ File "C:\Users\rusta\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\element.py", line 2308, in __getattr__
+ raise AttributeError(
+AttributeError: ResultSet object has no attribute 'text'. You're probably treating a list of elements like a single element. Did you call find_all() when you meant to call find()?
+sstavki = bs.find('span', 'odd-coefficient')
+Traceback (most recent call last):
+ File "", line 1, in
+ sstavki = bs.find('span', 'odd-coefficient')
+NameError: name 'bs' is not defined. Did you mean: 's'?
+stavki=soup.find_all('span', class_='odd-coefficient')
+print (stavki[0].text)
+Traceback (most recent call last):
+ File "", line 1, in
+ print (stavki[0].text)
+IndexError: list index out of range
+print(stavki.text)
+Traceback (most recent call last):
+ File "", line 1, in
+ print(stavki.text)
+ File "C:\Users\rusta\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\element.py", line 2308, in __getattr__
+ raise AttributeError(
+AttributeError: ResultSet object has no attribute 'text'. You're probably treating a list of elements like a single element. Did you call find_all() when you meant to call find()?
+browser.get('https://1whis.pro/bets/prematch/18/512/3370/11177828')
+browser.get('https://1whis.pro/bets/prematch/18/144/1000/10973252')
+html_text = browser.page_source
+soup = BeautifulSoup(html_text, 'lxml')
+stavki=soup.find_all('span', class_='odd-coefficient')
+print(stavki.text)
+Traceback (most recent call last):
+ File "", line 1, in
+ print(stavki.text)
+ File "C:\Users\rusta\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\element.py", line 2308, in __getattr__
+ raise AttributeError(
+AttributeError: ResultSet object has no attribute 'text'. You're probably treating a list of elements like a single element. Did you call find_all() when you meant to call find()?
+print(stavki)
+[1.34, 5.12, 9.99, 7.4, 2.28, 1.04, 1.59, 1.01, 1.15, 1.31, 1.6, 2.02, 2.69, 3.58, 5.49, 11.17, 4.83, 3.15, 2.2, 1.71, 1.41, 1.25, 1.11, 1.19, 1.38, 1.73, 2.24, 3.1, 4.24, 6.64, 1.05, 7.74, 4.23, 2.83, 1.99, 1.58, 1.32, 1.18, 1.08, 1.33, 1.66, 2.24, 3.11, 3.17, 2.14, 1.6, 1.34, 2.62, 5.59, 9.28, 1.45, 1.12, 1.04, 5.94, 198.99, 198.99, 495, 495, 495, 495, 495, 495, 495, 495, 5.45, 7.92, 7.92, 10.89, 22.77, 13.86, 17.82, 50.49, 198.99, 30.69, 45.54, 99.99, 198.99, 198.99, 80.19, 99.99, 198.99, 198.99, 198.99, 198.99, 198.99, 198.99, 198.99, 198.99, 198.99, 495, 495, 198.99, 198.99, 198.99, 198.99, 495, 495, 495, 495, 198.99, 198.99, 198.99, 495, 495, 495, 495, 495, 495, 14.85, 9.7, 198.99, 198.99, 198.99, 198.99, 198.99, 9.4, 198.99, 198.99, 198.99, 198.99, 198.99, 495, 25.74, 198.99, 198.99, 198.99, 198.99, 198.99, 495, 99.99, 198.99, 198.99, 198.99, 198.99, 495, 495, 198.99, 198.99, 198.99, 198.99, 495, 495, 495, 198.99, 198.99, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 18.81, 45.54, 174.24, 198.99, 198.99, 22.77, 90.09, 198.99, 198.99, 90.09, 198.99, 198.99, 10.96, 9.8, 7.62, 5, 1.06, 1.14, 8.5, 14.36, 4.15, 9.8, 1.18, 1.04, 7.51, 29.7, 3.88, 13.37, 1.23, 1.01, 7.22, 37.62, 3.46, 26.73, 1.01, 1.28, 8.05, 52.47, 3.27, 33.66, 1.02, 1.29, 8.14, 1.02, 3.08, 3.6, 2.08, 2.04, 3.44, 6.55, 15, 23, 1.03, 3.44, 3.98, 5.9, 10, 17, 10, 19.96, 3.34, 1.84, 1.28, 1.05, 1.01, 19, 32.29, 4.33, 1.18, 63.36, 1.58, 2.6, 5.31, 10.47, 29.87, 50.54, 2.77, 1.49, 1.13, 1.26, 1.88, 2.95, 5.5, 4.92, 3.61, 3.91, 5.8, 9.77, 3.44, 1.98, 1.34, 6.5, 2.73, 1.73, 1.33, 4.27, 9.72, 2.73, 1.38, 7.4, 1.04, 1.73, 1.96, 10.55, 3.18, 3.08, 2.22, 2.5, 1.43, 7.66, 1.03, 3.68, 1.21, 3.91, 1.18, 6.07, 1.07, 2.73, 1.36, 10.35, 2.32, 1.5, 13.86, 8.72, 1.01, 6.02, 1.07, 5.06, 1.11, 11.61, 5.06, 1.11, 18.81, 4.75, 1.16, 45.54, 11.38, 1.01, 1.11, 1.9, 5.59, 2.65, 5.77, 11.6, 5.1, 1.7, 1.09, 1.39, 1.08, 8.18, 56.43, 1.02, 1.54, 3.37, 1.29, 2.38, 7.03, 2.11, 1.62, 1.3, 2.87, 5.75, 1.06, 1.59, 2.03, 2.43, 1.41, 2.41, 1.42, 2.44, 6.93, 3.46, 3.33, 4.26, 2.54, 5.54, 9.7, 4.89, 3.68, 4, 5.74, 9.6, 1.14, 1.26, 2.13, 1.92, 3.86, 3.37, 1.6, 1.7, 3.01, 5.45, 11.88, 39.6, 1.36, 3.76, 1.19, 1.24, 4.32, 1.13, 1.06, 1.18, 3.39, 9.8, 8.8, 3.54, 2.82, 1.96, 1.53, 1.34, 1.13, 1.1, 1.01, 1.03, 1.01, 1.03, 1.26, 1.41, 1.85, 2.44, 3.04, 4.9, 5.5, 9.7, 12, 19.35, 28.33, 1.07, 1.51, 1.99, 2.82, 3.44, 6, 6.55, 14.64, 15.11, 7.2, 2.52, 1.79, 1.42, 1.28, 1.09, 1.06, 1.01, 1.01, 1.09, 1.53, 1.98, 2.67, 5.42, 11.83, 6.86, 2.45, 1.8, 1.46, 1.14, 1.03, 1.96, 3.9, 5.58, 1.82, 1.23, 1.14, 1.33, 1.57, 2.28, 3.74, 7, 4.3, 4.8, 6.91, 11, 17, 9.8, 3.54, 2.01, 1.34, 1.1, 5.02, 1.55, 3.76, 1.31, 1.09, 2.11, 1.17, 2.8, 2.89, 1.98, 2, 1.87, 1.29, 1.62, 1.61, 1.71, 1.85, 3.28, 1.45, 2.94, 1.73, 1.23, 2.33, 1.28, 1.52, 5.36, 1.19, 5.26, 2.16, 1.07, 3.58, 1.08, 1.32, 9.48, 1.07, 9.53, 2.74, 5.41, 4.04, 1.17, 1.8, 21.78, 66.33, 14.85, 9.9, 3.8, 6.83, 18.81, 25.74, 23.76, 16.83, 1.68, 2.02, 1.18, 4.25, 2.8, 1.37, 1.59, 2.12, 13.86, 5.1, 2.87, 6.83, 3.8, 18.81, 55.44, 12.87, 24.75, 2.55, 5.09, 3.34, 4.45, 2.45, 1.47, 2.47, 1.81, 8.91, 1.84, 6.68, 2.28, 14.85, 3.27, 20.79, 6.43, 18.81, 14.85, 9.4, 18.81, 6.93, 6.5, 6.43, 7.92, 10.89, 10.89, 8.91, 14.85, 33.66, 7.42, 18.81, 14.85, 2.5, 18.81, 8.91, 6, 9.9, 14.85, 6.5, 6.5, 18.81, 6.43, 4.5, 2.4, 7.5, 18.81, 20.79, 22.77, 9.4, 28.71, 7.5, 25.74, 11.88, 6, 28.71, 7.92, 9.4, 28.71, 18.81, 1.08, 1.47, 1.09, 1.08, 1.08, 1.16, 1.51, 1.06, 1.06, 1.09, 2.68, 3.61, 5.43, 3.35, 1.39, 1.23, 1.1, 1.26, 2.69, 1.37, 21.78, 3.46, 3.72, 5.84, 1.94, 2.6, 3.66, 8.91, 27.72, 59.4, 7.06, 20.79, 99.99, 1.29, 1.2, 1.11, 1.71, 1.45, 1.01, 1.04, 5.35, 5.06, 1.57, 3.89, 8.5, 198.99, 14.85, 297.99, 45.54, 248.49, 198.99, 80.19, 248.49, 50.49, 45.54, 45.54, 60.39, 99.99, 99.99, 99.99, 198.99, 347.49, 80.19, 248.49, 198.99, 9.4, 248.49, 70.29, 50.49, 99.99, 198.99, 33.66, 16.83, 248.49, 45.54, 14.85, 8.7, 99.99, 248.49, 297.99, 297.99, 80.19, 396.99, 18.81, 396.99, 297.99, 50.49, 396.99, 60.39, 80.19, 396.99, 248.49, 28.71, 495.99, 70.29, 495.99, 248.49, 495.99, 495.99, 495.99, 495.99, 297.99, 248.49, 248.49, 396.99, 495.99, 495.99, 396.99, 495.99, 495.99, 248.49, 495.99, 495.99, 25.74, 495.99, 495.99, 297.99, 495.99, 495.99, 198.99, 80.19, 495.99, 248.49, 70.29, 24.75, 495.99, 495.99, 495.99, 495.99, 495.99, 495.99, 99.99, 495.99, 495.99, 297.99, 495.99, 396.99, 495.99, 495.99, 495.99, 1.02, 1.03, 6.14, 1.07, 1.92, 1.79, 4.51, 2.35, 1.6, 1.86, 3.16, 3.24, 4.12, 1.14, 1.48, 1.92, 1.68, 1.28, 1.26, 1.17, 1.6, 2.88, 5.83, 2.1, 1.33, 1.08, 5.35, 1.12, 2.48, 1.48, 3.37, 3.69, 1.21, 1.22, 1.81, 9.25, 1.02, 6.45, 1.04, 14.85, 1.72, 2.73, 8.41, 32.67, 6.53, 25.74, 47.52, 2.25, 1.48, 1.23, 3.27, 2.45, 1.4, 10.08, 1.05, 5.29, 4.22, 1.23, 1.42, 1.7, 2.09, 2.62, 3.31, 1.13, 3.25, 2.39, 1.88, 1.56, 1.35, 1.22, 4.19, 4.39, 1.53, 8.21, 7.63, 4.06, 3.47, 2.37, 1.96, 1.63, 1.38, 1.28, 1.01, 1.14, 1.2, 1.43, 1.64, 1.98, 2.51, 2.96, 1.21, 1.71, 2.74, 5.94, 3.39, 1.87, 1.32, 1.05, 1.02, 1.48, 1.86, 3.03, 2, 1.44, 1.14, 1.1, 1.02, 1.37, 1.79, 2.73, 5.55, 6.79, 12.78, 1.13, 3.07, 4.34, 10.09, 11.05, 5.05, 1.33, 1.18, 1.02, 1.01, 1.56, 2.42, 3.7, 9, 11, 2.33, 1.52, 1.25, 1.04, 1.02, 3.4, 13, 1.29, 1.01, 1.71, 5.67, 3.03, 7.53, 11.77, 2.28, 6.19, 1.01, 1.47, 1.04, 6.97, 1.9, 1.02, 1.68, 6.52, 1.87, 1.03, 1.71, 3.68, 2.46, 2.38, 1.74, 1.94, 3.01, 4.16, 8.91, 1.42, 1.22, 1.63, 2.87, 2.08, 1.39, 2.7, 18.81, 1.1, 1.34, 6.73, 2.51, 7.87, 1.05, 1.24, 4.3, 18.81, 20.79, 40.59, 7.42, 1.02, 9.7, 1.03, 1.34, 2.11, 3.96, 2.77, 1.73, 1.3, 1.19, 1.06, 1.05, 1.22, 1.41, 2.04, 3.31, 4.31, 7.4, 8.74, 1.12, 2.32, 3.24, 6.79, 7.78, 5.29, 1.54, 1.3, 1.07, 1.05, 1.38, 1.81, 2.74, 5.45, 6.9, 2.9, 1.94, 1.42, 1.13, 1.08, 2.9, 9.41, 12.75, 1.38, 1.04, 1.01, 1.54, 5.23, 4.03, 3.16, 2.61, 1.87, 2.07, 1.25, 1.36, 1.71, 1.57, 2.12, 4.42, 1.29, 4.22, 1.54, 1.12, 2.89, 1.13, 1.72, 8.83, 1.12, 8.18, 1.85, 4.4, 3.32, 8.3, 19, 28.49, 1.04, 2.91, 5.05, 11, 20.63, 8.5, 2.13, 1.31, 1.02, 23, 13.1, 3.63, 1.34, 1.56, 2.22, 3.13, 1.25, 2.6, 1.36, 2.96, 2.51, 4.16, 2.71, 7.42, 7.1, 1.06, 4, 3.54, 6.43, 1.42, 1.29, 1.53, 2.3, 2.28, 1.53, 2.04, 10.89, 1.17, 1.18, 4.36, 2.75, 3.19, 1.24, 1.1, 15.95, 6.62, 1.78, 1.61, 1.45, 1.38, 1.22, 1.12, 1.06, 1.01, 5.94, 4.04, 2.54, 2.32, 1.98, 1.79, 2.01, 2.32, 2.54, 3.31, 4.37, 5.75, 7.74, 9.45, 11.77, 1.05, 1.15, 1.38, 1.45, 1.62, 1.21, 1.65, 2.44, 3.71, 5.69, 8.5, 9.38, 3.39, 1.95, 1.41, 1.18, 1.06, 2.31, 1.16, 1.17, 1.14, 1.27, 1.79, 2.62, 3.39, 8.03, 4.08, 2.98, 1.79, 1.35, 1.21, 1.81, 2.42, 8.2, 5.7, 1.13, 1.5, 2.25, 3.44, 5.98, 2.48, 1.6, 1.28, 1.11, 1.49, 2.17, 3.72, 6.02, 1.1, 6.12, 2.52, 1.64, 1.25, 1.11, 1.8, 3.07, 1.94, 1.34, 3.07, 6.43, 18.81, 18.81, 40.59, 80.19, 45.54, 70.29, 495, 495, 80.19, 495, 495, 495, 495, 14.85, 3.01, 99.99, 8.41, 99.99, 495, 55.44, 495, 495, 495, 495, 495, 495, 495, 495, 8.91, 40.59, 80.19, 99.99, 40.59, 90.09, 90.09, 2.89, 3.42, 1.55, 2.68, 1.29, 1.21, 2.11, 1.34, 2.11, 6.27, 1.17, 6.1, 1.55, 1.04, 3.76, 1.05, 1.81, 1.07, 1.76, 5.34, 4.5, 12, 26, 1.03, 2.83, 6.15, 13, 8.5, 1.88, 1.19, 1.01, 29, 1.71, 5.67, 3.03, 9.5, 1.01, 2.87, 1.33, 7.73, 1.03, 2.34, 1.49, 2.34, 1.49, 2.05, 1.68, 2.37, 2.45, 4.95, 3.66, 10.89, 3.03, 1.27, 3.27, 1.23, 1.62, 2.91, 7.9, 4.07, 1.2, 1.29, 1.73, 2.43, 3.77, 3.37, 2.03, 1.52, 1.24, 1.39, 1.87, 2.83, 4.37, 2.87, 1.87, 1.4, 1.19, 1.5, 2.26, 2.47, 1.59, 4.49, 1.18, 3.27, 5.74, 14.85, 12.87, 33.66, 70.29, 35.64, 60.39, 495, 495, 66.33, 495, 495, 495, 495, 14.85, 4, 90.09, 8.41, 90.09, 495, 45.54, 495, 495, 495, 495, 495, 495, 495, 495, 9.9, 40.59, 80.19, 90.09, 35.64, 80.19, 80.19, 7.82, 11.14, 2.85, 5.36, 1.01, 1.3, 1.07, 7.07, 2.22, 1.02, 1.5, 6.34, 2.14, 1.04, 1.53, 2.72, 2.52, 2.97, 1.55, 5.13, 4.02, 1.87, 1.83, 6.83, 1.03, 9.24, 1.34, 3.68, 14.85, 13.37, 35.64, 8.09, 1.02, 3.78, 1.2, 6.89, 1.05, 2.8, 1.35, 2.8, 1.35]
+print(stavki.text)
+Traceback (most recent call last):
+ File "", line 1, in
+ print(stavki.text)
+ File "C:\Users\rusta\AppData\Local\Programs\Python\Python311\Lib\site-packages\bs4\element.py", line 2308, in __getattr__
+ raise AttributeError(
+AttributeError: ResultSet object has no attribute 'text'. You're probably treating a list of elements like a single element. Did you call find_all() when you meant to call find()?
+print(stavki[0].text)
+1.34
+for i in (0, 735):
+print(stavki[i].text)
+SyntaxError: expected an indented block after 'for' statement on line 1
+for i in (0, 735):
+ print(stavki[i].text)
+
+1.34
+1.12
+a = 0
+while a <= 735:
+... a += 1
+... print(stavki[i].text)
+...
+...
+1.12
+1.12
+1.12
+1.12
+1.12
+1.12
+1.12
+1.12
+1.12
+1.12
+1.12
+Traceback (most recent call last):
+ File "", line 3, in
+ print(stavki[i].text)
+KeyboardInterrupt
+>>> while a <= 735:
+... a += 1
+... print(stavki[a].text)
+...
+...
+2.69
+3.58
+5.49
+11.17
+4.83
+3.15
+2.2
+1.71
+1.41
+1.25
+1.11
+1.19
+1.38
+1.73
+2.24
+3.1
+4.24
+6.64
+1.05
+7.74
+4.23
+2.83
+1.99
+1.58
+1.32
+1.18
+1.08
+1.33
+1.66
+2.24
+3.11
+3.17
+2.14
+1.6
+1.34
+2.62
+5.59
+9.28
+1.45
+1.12
+1.04
+5.94
+198.99
+198.99
+495
+495
+495
+495
+495
+495
+495
+495
+5.45
+7.92
+7.92
+10.89
+22.77
+13.86
+17.82
+50.49
+198.99
+30.69
+45.54
+99.99
+198.99
+198.99
+80.19
+99.99
+198.99
+198.99
+198.99
+198.99
+198.99
+198.99
+198.99
+198.99
+198.99
+495
+495
+198.99
+198.99
+198.99
+198.99
+495
+495
+495
+495
+198.99
+198.99
+198.99
+495
+495
+495
+495
+495
+495
+14.85
+9.7
+198.99
+198.99
+198.99
+198.99
+198.99
+9.4
+198.99
+198.99
+198.99
+198.99
+198.99
+495
+25.74
+198.99
+198.99
+198.99
+198.99
+198.99
+495
+99.99
+198.99
+198.99
+198.99
+198.99
+495
+495
+198.99
+198.99
+198.99
+198.99
+495
+495
+495
+198.99
+198.99
+495
+495
+495
+495
+495
+495
+495
+495
+495
+495
+495
+495
+495
+495
+495
+495
+495
+495
+18.81
+45.54
+174.24
+198.99
+198.99
+22.77
+90.09
+198.99
+198.99
+90.09
+198.99
+198.99
+10.96
+9.8
+7.62
+5
+1.06
+1.14
+8.5
+14.36
+4.15
+9.8
+1.18
+1.04
+7.51
+29.7
+3.88
+13.37
+1.23
+1.01
+7.22
+37.62
+3.46
+26.73
+1.01
+1.28
+8.05
+52.47
+3.27
+33.66
+1.02
+1.29
+8.14
+1.02
+3.08
+3.6
+2.08
+2.04
+3.44
+6.55
+15
+23
+1.03
+3.44
+3.98
+5.9
+10
+17
+10
+19.96
+3.34
+1.84
+1.28
+1.05
+1.01
+19
+32.29
+4.33
+1.18
+63.36
+1.58
+2.6
+5.31
+10.47
+29.87
+50.54
+2.77
+1.49
+1.13
+1.26
+1.88
+2.95
+5.5
+4.92
+3.61
+3.91
+5.8
+9.77
+3.44
+1.98
+1.34
+6.5
+2.73
+1.73
+1.33
+4.27
+9.72
+2.73
+1.38
+7.4
+1.04
+1.73
+1.96
+10.55
+3.18
+3.08
+2.22
+2.5
+1.43
+7.66
+1.03
+3.68
+1.21
+3.91
+1.18
+6.07
+1.07
+2.73
+1.36
+10.35
+2.32
+1.5
+13.86
+8.72
+1.01
+6.02
+1.07
+5.06
+1.11
+11.61
+5.06
+1.11
+18.81
+4.75
+1.16
+45.54
+11.38
+1.01
+1.11
+1.9
+5.59
+2.65
+5.77
+11.6
+5.1
+1.7
+1.09
+1.39
+1.08
+8.18
+56.43
+1.02
+1.54
+3.37
+1.29
+2.38
+7.03
+2.11
+1.62
+1.3
+2.87
+5.75
+1.06
+1.59
+2.03
+2.43
+1.41
+2.41
+1.42
+2.44
+6.93
+3.46
+3.33
+4.26
+2.54
+5.54
+9.7
+4.89
+3.68
+4
+5.74
+9.6
+1.14
+1.26
+2.13
+1.92
+3.86
+3.37
+1.6
+1.7
+3.01
+5.45
+11.88
+39.6
+1.36
+3.76
+1.19
+1.24
+4.32
+1.13
+1.06
+1.18
+3.39
+9.8
+8.8
+3.54
+2.82
+1.96
+1.53
+1.34
+1.13
+1.1
+1.01
+1.03
+1.01
+1.03
+1.26
+1.41
+1.85
+2.44
+3.04
+4.9
+5.5
+9.7
+12
+19.35
+28.33
+1.07
+1.51
+1.99
+2.82
+3.44
+6
+6.55
+14.64
+15.11
+7.2
+2.52
+1.79
+1.42
+1.28
+1.09
+1.06
+1.01
+1.01
+1.09
+1.53
+1.98
+2.67
+5.42
+11.83
+6.86
+2.45
+1.8
+1.46
+1.14
+1.03
+1.96
+3.9
+5.58
+1.82
+1.23
+1.14
+1.33
+1.57
+2.28
+3.74
+7
+4.3
+4.8
+6.91
+11
+17
+9.8
+3.54
+2.01
+1.34
+1.1
+5.02
+1.55
+3.76
+1.31
+1.09
+2.11
+1.17
+2.8
+2.89
+1.98
+2
+1.87
+1.29
+1.62
+1.61
+1.71
+1.85
+3.28
+1.45
+2.94
+1.73
+1.23
+2.33
+1.28
+1.52
+5.36
+1.19
+5.26
+2.16
+1.07
+3.58
+1.08
+1.32
+9.48
+1.07
+9.53
+2.74
+5.41
+4.04
+1.17
+1.8
+21.78
+66.33
+14.85
+9.9
+3.8
+6.83
+18.81
+25.74
+23.76
+16.83
+1.68
+2.02
+1.18
+4.25
+2.8
+1.37
+1.59
+2.12
+13.86
+5.1
+2.87
+6.83
+3.8
+18.81
+55.44
+12.87
+24.75
+2.55
+5.09
+3.34
+4.45
+2.45
+1.47
+2.47
+1.81
+8.91
+1.84
+6.68
+2.28
+14.85
+3.27
+20.79
+6.43
+18.81
+14.85
+9.4
+18.81
+6.93
+6.5
+6.43
+7.92
+10.89
+10.89
+8.91
+14.85
+33.66
+7.42
+18.81
+14.85
+2.5
+18.81
+8.91
+6
+9.9
+14.85
+6.5
+6.5
+18.81
+6.43
+4.5
+2.4
+7.5
+18.81
+20.79
+22.77
+9.4
+28.71
+7.5
+25.74
+11.88
+6
+28.71
+7.92
+9.4
+28.71
+18.81
+1.08
+1.47
+1.09
+1.08
+1.08
+1.16
+1.51
+1.06
+1.06
+1.09
+2.68
+3.61
+5.43
+3.35
+1.39
+1.23
+1.1
+1.26
+2.69
+1.37
+21.78
+3.46
+3.72
+5.84
+1.94
+2.6
+3.66
+8.91
+27.72
+59.4
+7.06
+20.79
+99.99
+1.29
+1.2
+1.11
+1.71
+1.45
+1.01
+1.04
+5.35
+5.06
+1.57
+3.89
+8.5
+198.99
+14.85
+297.99
+45.54
+248.49
+198.99
+80.19
+248.49
+50.49
+45.54
+45.54
+60.39
+99.99
+99.99
+99.99
+198.99
+347.49
+80.19
+248.49
+198.99
+9.4
+248.49
+70.29
+50.49
+99.99
+198.99
+33.66
+16.83
+248.49
+45.54
+14.85
+8.7
+99.99
+248.49
+297.99
+297.99
+80.19
+396.99
+18.81
+396.99
+297.99
+50.49
+396.99
+60.39
+80.19
+396.99
+248.49
+28.71
+495.99
+70.29
+495.99
+248.49
+495.99
+495.99
+495.99
+495.99
+297.99
+248.49
+248.49
+396.99
+495.99
+495.99
+396.99
+495.99
+495.99
+248.49
+495.99
+495.99
+25.74
+495.99
+495.99
+297.99
+495.99
+495.99
+198.99
+80.19
+495.99
+248.49
+70.29
+24.75
+495.99
+495.99
+495.99
+495.99
+495.99
+495.99
+99.99
+495.99
+495.99
+297.99
+495.99
+396.99
+495.99
+495.99
+495.99
+1.02
+1.03
+6.14
+1.07
+1.92
+1.79
+4.51
+2.35
+1.6
+1.86
+3.16
+3.24
+4.12
+1.14
+1.48
+1.92
+1.68
+1.28
+1.26
+1.17
+1.6
+2.88
+5.83
+2.1
+1.33
+1.08
+5.35
+1.12
+2.48
diff --git a/Задания/task1/Samigullin/test b/Задания/task1/Samigullin/test
new file mode 100644
index 0000000..9daeafb
--- /dev/null
+++ b/Задания/task1/Samigullin/test
@@ -0,0 +1 @@
+test
diff --git a/Задания/task1/Uskova/parcing.py b/Задания/task1/Uskova/parcing.py
new file mode 100644
index 0000000..17aeb52
--- /dev/null
+++ b/Задания/task1/Uskova/parcing.py
@@ -0,0 +1,14 @@
+from bs4 import BeautifulSoup
+from selenium.webdriver import Chrome
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+import time
+s = Service('C:\\Users\\Yekaterina\\Downloads\\chromedriver_win32\\chromedriver.exe')
+browser = webdriver.Chrome(service=s)
+browser.get('https://www.citilink.ru/catalog/noutbuki/')
+html_text = browser.page_source
+soup = BeautifulSoup(html_text, 'lxml')
+name=soup.find_all('div', class_='app-catalog-1tp0ino e1an64qs0')
+print (name[0].text)
+description=soup.find_all('div', class_='app-catalog-1o4umte eevw8x70')
+print (description[0].text)
diff --git a/Задания/task1/Yaroshevskiy/main.py b/Задания/task1/Yaroshevskiy/main.py
index fae989b..945ddf8 100644
--- a/Задания/task1/Yaroshevskiy/main.py
+++ b/Задания/task1/Yaroshevskiy/main.py
@@ -1,40 +1,28 @@
-# установи python, pip
-
-# выполни эту команду: pip install selenium bs4 lxml
-# если ты используешь pycharm, то надо библиотеки ставить не в консоли(терминале), а в самом pycharm
-# для этого нажми "view" > "tool windows" > "python packages"
-# внизу в окне поиска ищи нужные библиотеки
-# когда найдешь, нажимай на нее, справа будет кнопка "install package", устанавливай, потом перезапусти pycharm
-
-# найди версию своего браузера
-# напиши в гугле "скачать драйвер для <название и версия твоего браузера> selenium"
-# теперь все готово для запуска этого
-# помните, что сам сайт(который вы хотите парсить) может вас блокировать или заставлять проходить capture, из-за чего этот код ничего не выведет
-
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("путь_до_драйвера") # в ковычках указываем полный путь до скаченного ранее драйвера
-# если ты на винде, то вместо знака "\" пиши "\\"
-brow = webdriver.Chrome(service=s) # как будто создаем виртуальный браузер
+brow = webdriver.Chrome()
+url = "https://ikey.ru/"
+brow.get(url)
-brow.get("https://www.revshells.com/") # получаем html код сайта и другую информацию(она нам не нужна сейчас)
+html = brow.page_source
-html = brow.page_source # копируем html код в переменную
+soup = BeautifulSoup(html, "lxml")
-soup = BeautifulSoup(html, "lxml") # создаем специальный парсер
+products = soup.find_all(attrs={"class": "product"})
-buttons = soup.find_all(attrs={"class": "list-group-item list-group-item-action"})
-# получаем список всех html тегов, в которых есть атрибут "class", равный: "list-group-item list-group-item-action"
-
-for button in buttons:
- # выводим текст каждого тега
- print(button.text)
-
-# от сердца и почек
-# дарю вам питончик
-# made by perfecto
+with psyc.connect(dbname="db_for_parse", user="perfecto") as conn:
+ with conn.cursor() as cursor:
+ for i, product in enumerate(products):
+ img_tag = product.find(attrs={"class": "imagef"}).find("img")
+ title = img_tag.attrs.get("alt")
+ image = url + img_tag.attrs.get("src")
+ download(url + img_tag.attrs.get("src"), f"images/{i}.jpg")
+ cursor.execute(f"insert into images(link, name) values ('{image}', '{title}')")
+
+ conn.commit()
diff --git a/Задания/task1/nikitin/test2.py b/Задания/task1/nikitin/test2.py
new file mode 100644
index 0000000..553f156
--- /dev/null
+++ b/Задания/task1/nikitin/test2.py
@@ -0,0 +1,12 @@
+from bs4 import BeautifulSoup
+from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
+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')
+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