From 1d8f5250173ebd20623bba342897d37c819acf7f Mon Sep 17 00:00:00 2001 From: nikitin712 Date: Thu, 16 Feb 2023 11:53:30 +0300 Subject: [PATCH 01/35] =?UTF-8?q?=D0=A2=D0=B5=D1=81=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Задания/task1/nikitin/test2.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Задания/task1/nikitin/test2.py diff --git a/Задания/task1/nikitin/test2.py b/Задания/task1/nikitin/test2.py new file mode 100644 index 0000000..76e20d3 --- /dev/null +++ b/Задания/task1/nikitin/test2.py @@ -0,0 +1,15 @@ +from bs4 import BeautifulSoup +from selenium import webdriver +from selenium.webdriver import Chrome +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.kinopoisk.ru/list/movies/top250/') +html_text = browser.page_source +soup = BeautifulSoup(html_text, 'lxml') +films=soup.find_all('div', class_='base-movie-main-info_mainInfo__Zl_u3') + +for film in films: + print(film.text) From d1a1d9c373dc68adaa92ff4277a97f2a9b510376 Mon Sep 17 00:00:00 2001 From: Harutyun Date: Fri, 17 Feb 2023 00:44:31 +0300 Subject: [PATCH 02/35] IDFC --- Задания/task1/Garanyan/main.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Задания/task1/Garanyan/main.py diff --git a/Задания/task1/Garanyan/main.py b/Задания/task1/Garanyan/main.py new file mode 100644 index 0000000..5cf8376 --- /dev/null +++ b/Задания/task1/Garanyan/main.py @@ -0,0 +1,12 @@ +from bs4 import BeautifulSoup +from selenium import webdriver +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/") +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) From 6970223ab755a70451d987ddf3e1dfcc98912ee2 Mon Sep 17 00:00:00 2001 From: Lady Di <93448337+dialuna@users.noreply.github.com> Date: Sat, 18 Feb 2023 02:19:04 +0300 Subject: [PATCH 03/35] parser --- Задания/task1/Gasanova/parser.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Задания/task1/Gasanova/parser.py diff --git a/Задания/task1/Gasanova/parser.py b/Задания/task1/Gasanova/parser.py new file mode 100644 index 0000000..a2f1561 --- /dev/null +++ b/Задания/task1/Gasanova/parser.py @@ -0,0 +1,9 @@ +#made by dialuna (or just Diana Gasanova) <3 +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) From c6cc443ac3bda2a874e7e8267225c024972f4686 Mon Sep 17 00:00:00 2001 From: VladEpifanov Date: Sat, 18 Feb 2023 13:22:24 +0300 Subject: [PATCH 04/35] =?UTF-8?q?=D0=9F=D0=B0=D1=80=D1=81=D0=B8=D0=BD?= =?UTF-8?q?=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Задания/task1/Epifanov/Парсинг.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Задания/task1/Epifanov/Парсинг.py diff --git a/Задания/task1/Epifanov/Парсинг.py b/Задания/task1/Epifanov/Парсинг.py new file mode 100644 index 0000000..8914bf7 --- /dev/null +++ b/Задания/task1/Epifanov/Парсинг.py @@ -0,0 +1,13 @@ +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://pythonpip.ru/examples/kak-posmotret-ustanovlennye-moduli-python-i-vyvesti-ih-spisok') +html_text = browser.page_source +print(html_text) +soup = BeautifulSoup(html_text, 'lxml') +infos = soup.find_all(attrs={"class":"relpost-block-single-text"}) +for info in infos: + print(info.text) From a8df58832c7f39e120241c8eec946a6d923bffe6 Mon Sep 17 00:00:00 2001 From: Sanich777 Date: Tue, 21 Feb 2023 02:01:03 +0300 Subject: [PATCH 05/35] parser --- .idea/workspace.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index cc64d58..ff25148 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,7 +5,6 @@ - From a847ff4491804189456c68be273bc90d24abdfd9 Mon Sep 17 00:00:00 2001 From: Sanich777 Date: Tue, 21 Feb 2023 02:04:03 +0300 Subject: [PATCH 06/35] parser --- .idea/workspace.xml | 16 +++++++++++----- Задания/task1/Kulikov/main.py | 25 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 Задания/task1/Kulikov/main.py diff --git a/.idea/workspace.xml b/.idea/workspace.xml index ff25148..4af5b6a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,9 +4,7 @@ - - - + @@ -125,7 +130,8 @@ - diff --git a/Задания/task1/Kulikov/main.py b/Задания/task1/Kulikov/main.py new file mode 100644 index 0000000..8bcd915 --- /dev/null +++ b/Задания/task1/Kulikov/main.py @@ -0,0 +1,25 @@ +# pip install selenium bs4 + + +from bs4 import BeautifulSoup +from selenium import webdriver +from selenium.webdriver.chrome.service import Service +from time import sleep + + +s = Service("C:\\Users\\Alex\\PycharmProjects\\pythonProject\\chromedriver.exe") +brow = webdriver.Chrome(service=s) + +# brow.get("https://www.kinopoisk.ru/lists/movies/top250/") +brow.get("https://www.revshells.com/") +sleep(10) + +html = brow.page_source + +soup = BeautifulSoup(html, "lxml") + +# films = soup.find_all(attrs={"class": "styles_mainTitle__IFQyZ styles_activeMovieTittle__kJdJj"}) +buttons = soup.find_all(attrs={"class": "list-group-item list-group-item-action"}) + +for button in buttons: + print(button.text) \ No newline at end of file From 98610da9b3bcef64a4f183fa197906cb0624997b Mon Sep 17 00:00:00 2001 From: KulishEV Date: Tue, 21 Feb 2023 13:55:38 +0300 Subject: [PATCH 07/35] =?UTF-8?q?=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- task1/Задание.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 task1/Задание.py diff --git a/task1/Задание.py b/task1/Задание.py new file mode 100644 index 0000000..ba0d567 --- /dev/null +++ b/task1/Задание.py @@ -0,0 +1,21 @@ + + +from bs4 import BeautifulSoup +from selenium.webdriver import Chrome +from selenium import webdriver +from selenium.webdriver.chrome.service import Service + +# Selenium - библиотека для автоматизации действий веб браузера, скрапинга +# запускаем браузер +s = Service('C:\data\hrome\chromedriver.exe') +browser = webdriver.Chrome(service=s) +browser.get('https://www.kinopoisk.ru/lists/movies/top250/') +html_text = browser.page_source +soup = BeautifulSoup(html_text, 'lxml') +films=soup.find_all('div', class_='base-movie-main-info_mainInfo__ZL_u3') +print (films[0].text) + +# Это пример парсинга. Вам необходимо спарсить 1 страницу каталога любого сайта на выбор. +# Спарсить необходимо только Заголовки и описание. + + From 564002929950c18f2a4ae341c5f06b0ef7c6c819 Mon Sep 17 00:00:00 2001 From: KulishEV Date: Tue, 21 Feb 2023 14:02:30 +0300 Subject: [PATCH 08/35] =?UTF-8?q?=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- task1/Задание.py | 1 + 1 file changed, 1 insertion(+) diff --git a/task1/Задание.py b/task1/Задание.py index ba0d567..19e86cd 100644 --- a/task1/Задание.py +++ b/task1/Задание.py @@ -16,6 +16,7 @@ films=soup.find_all('div', class_='base-movie-main-info_mainInfo__ZL_u3') print (films[0].text) # Это пример парсинга. Вам необходимо спарсить 1 страницу каталога любого сайта на выбор. +#сайты не должны повторяться # Спарсить необходимо только Заголовки и описание. From ec884a98a1ccd6d356b370e49ad8d351fb855fce Mon Sep 17 00:00:00 2001 From: KulishEV Date: Tue, 21 Feb 2023 14:10:09 +0300 Subject: [PATCH 09/35] =?UTF-8?q?=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- task1/Задание.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/task1/Задание.py b/task1/Задание.py index 19e86cd..5572aee 100644 --- a/task1/Задание.py +++ b/task1/Задание.py @@ -4,19 +4,18 @@ from bs4 import BeautifulSoup from selenium.webdriver import Chrome from selenium import webdriver from selenium.webdriver.chrome.service import Service +import time # Selenium - библиотека для автоматизации действий веб браузера, скрапинга # запускаем браузер s = Service('C:\data\hrome\chromedriver.exe') browser = webdriver.Chrome(service=s) browser.get('https://www.kinopoisk.ru/lists/movies/top250/') +time.sleep (10)#задержка для ввода капчи html_text = browser.page_source soup = BeautifulSoup(html_text, 'lxml') films=soup.find_all('div', class_='base-movie-main-info_mainInfo__ZL_u3') print (films[0].text) -# Это пример парсинга. Вам необходимо спарсить 1 страницу каталога любого сайта на выбор. -#сайты не должны повторяться -# Спарсить необходимо только Заголовки и описание. From 03e8e81b109e118c29f14836c54e8085b355a277 Mon Sep 17 00:00:00 2001 From: KulishEV Date: Tue, 21 Feb 2023 14:13:13 +0300 Subject: [PATCH 10/35] =?UTF-8?q?=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- task1/Задание.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/task1/Задание.py b/task1/Задание.py index 5572aee..30a573c 100644 --- a/task1/Задание.py +++ b/task1/Задание.py @@ -18,4 +18,6 @@ films=soup.find_all('div', class_='base-movie-main-info_mainInfo__ZL_u3') print (films[0].text) - +# Это пример парсинга. Вам необходимо спарсить 1 страницу каталога любого сайта на выбор. +#сайты не должны повторяться +# Спарсить необходимо только Заголовки и описание. \ No newline at end of file From 32face301d380c8943961cc67a322b28ff87556c Mon Sep 17 00:00:00 2001 From: VladEpifanov <124862300+VladEpifanov@users.noreply.github.com> Date: Tue, 21 Feb 2023 22:02:16 +0300 Subject: [PATCH 11/35] =?UTF-8?q?Delete=20=D0=9F=D0=B0=D1=80=D1=81=D0=B8?= =?UTF-8?q?=D0=BD=D0=B3.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Задания/task1/Epifanov/Парсинг.py | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 Задания/task1/Epifanov/Парсинг.py diff --git a/Задания/task1/Epifanov/Парсинг.py b/Задания/task1/Epifanov/Парсинг.py deleted file mode 100644 index 8914bf7..0000000 --- a/Задания/task1/Epifanov/Парсинг.py +++ /dev/null @@ -1,13 +0,0 @@ -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://pythonpip.ru/examples/kak-posmotret-ustanovlennye-moduli-python-i-vyvesti-ih-spisok') -html_text = browser.page_source -print(html_text) -soup = BeautifulSoup(html_text, 'lxml') -infos = soup.find_all(attrs={"class":"relpost-block-single-text"}) -for info in infos: - print(info.text) From 52ee8f08bbd2185a6a360b3c114c141887576f47 Mon Sep 17 00:00:00 2001 From: VladEpifanov Date: Tue, 21 Feb 2023 22:05:54 +0300 Subject: [PATCH 12/35] =?UTF-8?q?=D0=9F=D0=B0=D1=80=D1=81=D0=B8=D0=BD?= =?UTF-8?q?=D0=B3=20=D1=81=D0=B0=D0=B9=D1=82=D0=B0(=D0=97=D0=B0=D0=B4?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Задания/task1/Epifanov/1-sq.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Задания/task1/Epifanov/1-sq.py diff --git a/Задания/task1/Epifanov/1-sq.py b/Задания/task1/Epifanov/1-sq.py new file mode 100644 index 0000000..7c3826a --- /dev/null +++ b/Задания/task1/Epifanov/1-sq.py @@ -0,0 +1,13 @@ +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.rftoday.ru/_vse_zagolovki2') +html_text = browser.page_source +soup = BeautifulSoup(html_text, 'lxml') +infos = soup.find_all(attrs={"class": "title"}) +#print(infos[0].text) - если нужно вывести только n-ый заголовок +for info in infos: + print(info.text)#Вывод всех заголовков новостей страницы 1 From 036a126e7d2607ba1acd8c420556cd7d36d793c8 Mon Sep 17 00:00:00 2001 From: Sklvd Date: Thu, 23 Feb 2023 22:59:26 +0300 Subject: [PATCH 13/35] New commit for parsing --- Задания/task1/Kluchinskaya1/New commit for parsing | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Задания/task1/Kluchinskaya1/New commit for parsing diff --git a/Задания/task1/Kluchinskaya1/New commit for parsing b/Задания/task1/Kluchinskaya1/New commit for parsing new file mode 100644 index 0000000..e69de29 From 412215ef0d0196bfe8f41506c9d71ac559e2809d Mon Sep 17 00:00:00 2001 From: Sklvd Date: Thu, 23 Feb 2023 23:04:06 +0300 Subject: [PATCH 14/35] New commit for parsing1 --- Задания/task1/Kluchinskaya1/File | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Задания/task1/Kluchinskaya1/File b/Задания/task1/Kluchinskaya1/File index 8e27be7..b47e061 100644 --- a/Задания/task1/Kluchinskaya1/File +++ b/Задания/task1/Kluchinskaya1/File @@ -1 +1,15 @@ -text +>>> from bs4 import BeautifulSoup +>>> from selenium import webdriver +>>> from selenium.webdriver.chrome.service import Service +>>> s = Service('C:\\Users\\Dasha\\Desktop\\Progect\\chromedriver.exe') +>>> browser = webdriver.Chrome(service=s) +>>> browser.get('https://www.livelib.ru/selection/907286-vybor-redaktsii-elle-girl') +>>> html_text=browser.page_source +>>> soup=BeautifulSoup(html_text, 'lxml') +>>> infos = soup.find_ +>>> films=soup.find_all(attrs={"class": "brow-book-name with-cycle"} +) +>>> for film in films: + print(film.text) + + From 59de525818765617455e056694d7915a70629298 Mon Sep 17 00:00:00 2001 From: Sklvd Date: Thu, 23 Feb 2023 23:07:25 +0300 Subject: [PATCH 15/35] New commit for parsing --- Задания/task1/Kluchinskaya1/File | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Задания/task1/Kluchinskaya1/File b/Задания/task1/Kluchinskaya1/File index b47e061..5a81746 100644 --- a/Задания/task1/Kluchinskaya1/File +++ b/Задания/task1/Kluchinskaya1/File @@ -1,15 +1,14 @@ ->>> from bs4 import BeautifulSoup ->>> from selenium import webdriver ->>> from selenium.webdriver.chrome.service import Service ->>> s = Service('C:\\Users\\Dasha\\Desktop\\Progect\\chromedriver.exe') ->>> browser = webdriver.Chrome(service=s) ->>> browser.get('https://www.livelib.ru/selection/907286-vybor-redaktsii-elle-girl') ->>> html_text=browser.page_source ->>> soup=BeautifulSoup(html_text, 'lxml') ->>> infos = soup.find_ ->>> films=soup.find_all(attrs={"class": "brow-book-name with-cycle"} -) ->>> for film in films: + from bs4 import BeautifulSoup + from selenium import webdriver + from selenium.webdriver.chrome.service import Service + s = Service('C:\\Users\\Dasha\\Desktop\\Progect\\chromedriver.exe') +browser = webdriver.Chrome(service=s) + browser.get('https://www.livelib.ru/selection/907286-vybor-redaktsii-elle-girl') + html_text=browser.page_source + soup=BeautifulSoup(html_text, 'lxml') + infos = soup.find_ + films=soup.find_all(attrs={"class": "brow-book-name with-cycle"}) + for film in films: print(film.text) From eb44f5d4a1cb5c6ed3911ed9536b4d1a0f59ec92 Mon Sep 17 00:00:00 2001 From: Sklvd <124861780+Sklvd@users.noreply.github.com> Date: Thu, 23 Feb 2023 23:08:58 +0300 Subject: [PATCH 16/35] Delete New commit for parsing --- Задания/task1/Kluchinskaya1/New commit for parsing | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Задания/task1/Kluchinskaya1/New commit for parsing diff --git a/Задания/task1/Kluchinskaya1/New commit for parsing b/Задания/task1/Kluchinskaya1/New commit for parsing deleted file mode 100644 index e69de29..0000000 From 7a30054316524273db02f68c5684c666ae6feafb Mon Sep 17 00:00:00 2001 From: Sklvd Date: Thu, 23 Feb 2023 23:13:35 +0300 Subject: [PATCH 17/35] for parsing --- Задания/task1/Kluchinskaya1/New commit for parsing | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Задания/task1/Kluchinskaya1/New commit for parsing diff --git a/Задания/task1/Kluchinskaya1/New commit for parsing b/Задания/task1/Kluchinskaya1/New commit for parsing new file mode 100644 index 0000000..8d3dcdb --- /dev/null +++ b/Задания/task1/Kluchinskaya1/New commit for parsing @@ -0,0 +1,12 @@ + from bs4 import BeautifulSoup + from selenium import webdriver + from selenium.webdriver.chrome.service import Service + s = Service('C:\\Users\\Dasha\\Desktop\\Progect\\chromedriver.exe') +browser = webdriver.Chrome(service=s) + browser.get('https://www.livelib.ru/selection/907286-vybor-redaktsii-elle-girl') + html_text=browser.page_source + soup=BeautifulSoup(html_text, 'lxml') + infos = soup.find_ + films=soup.find_all(attrs={"class": "brow-book-name with-cycle"}) + for film in films: + print(film.text) \ No newline at end of file From e6ef06ebe574e8625a5888b45ebd82fd89943633 Mon Sep 17 00:00:00 2001 From: Sklvd Date: Thu, 23 Feb 2023 23:14:02 +0300 Subject: [PATCH 18/35] for parsing --- .idea/workspace.xml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 4af5b6a..de61904 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -33,15 +33,6 @@ - { - "keyToString": { - "RunOnceActivity.OpenProjectViewOnStart": "true", - "RunOnceActivity.ShowReadmeOnStart": "true", - "WebServerToolWindowFactoryState": "false", - "last_opened_file_path": "C:/Users/Alex/c22712", - "settings.editor.selected.configurable": "vcs.Git" - } -} From df2c5e857ce4adca0e457618afb5e98ac9e7dce9 Mon Sep 17 00:00:00 2001 From: Sklvd <124861780+Sklvd@users.noreply.github.com> Date: Thu, 23 Feb 2023 23:16:12 +0300 Subject: [PATCH 19/35] Delete File --- Задания/task1/Kluchinskaya1/File | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 Задания/task1/Kluchinskaya1/File diff --git a/Задания/task1/Kluchinskaya1/File b/Задания/task1/Kluchinskaya1/File deleted file mode 100644 index 5a81746..0000000 --- a/Задания/task1/Kluchinskaya1/File +++ /dev/null @@ -1,14 +0,0 @@ - from bs4 import BeautifulSoup - from selenium import webdriver - from selenium.webdriver.chrome.service import Service - s = Service('C:\\Users\\Dasha\\Desktop\\Progect\\chromedriver.exe') -browser = webdriver.Chrome(service=s) - browser.get('https://www.livelib.ru/selection/907286-vybor-redaktsii-elle-girl') - html_text=browser.page_source - soup=BeautifulSoup(html_text, 'lxml') - infos = soup.find_ - films=soup.find_all(attrs={"class": "brow-book-name with-cycle"}) - for film in films: - print(film.text) - - From 7dac6bdb2103513c48e32d19443102ea9eb90f44 Mon Sep 17 00:00:00 2001 From: Dronminator Date: Sat, 25 Feb 2023 20:11:03 +0300 Subject: [PATCH 20/35] =?UTF-8?q?=D0=94=D0=BE=D0=BC=D0=B0=D1=88=D0=BD?= =?UTF-8?q?=D0=B5=D0=B5=20=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8=D0=B5:=20?= =?UTF-8?q?=D0=9F=D0=B0=D1=80=D1=81=D0=B8=D0=BD=D0=B3=20=D0=A1=D0=B0=D0=B9?= =?UTF-8?q?=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/misc.xml | 2 +- Задания/task1/Lahin/parsing.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) 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/Задания/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 From 2f6dcba538c7a263f3dfe9e5966aa1d593b66520 Mon Sep 17 00:00:00 2001 From: Harutyun Date: Mon, 27 Feb 2023 23:55:04 +0300 Subject: [PATCH 21/35] parser --- venv/task 1/task1.py | 1 - 1 file changed, 1 deletion(-) delete mode 100644 venv/task 1/task1.py 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 From b055afe3f78edf4ffe63cc65a90dd9a266294d7f Mon Sep 17 00:00:00 2001 From: Harutyun Date: Mon, 27 Feb 2023 23:58:17 +0300 Subject: [PATCH 22/35] parser --- Задания/task1/Garanyan/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) From 87476b7d2a86b98c481331ca8a85285e7e912875 Mon Sep 17 00:00:00 2001 From: nikitin712 Date: Sat, 4 Mar 2023 14:39:05 +0300 Subject: [PATCH 23/35] =?UTF-8?q?=D0=94=D0=BE=D0=BC=D0=B0=D1=88=D0=BD?= =?UTF-8?q?=D0=B5=D0=B5=20=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8=D0=B5=201?= =?UTF-8?q?=20(=D0=9F=D0=B0=D1=80=D1=81=D0=B8=D0=BD=D0=B3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Задания/task1/nikitin/test2.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Задания/task1/nikitin/test2.py b/Задания/task1/nikitin/test2.py index 76e20d3..553f156 100644 --- a/Задания/task1/nikitin/test2.py +++ b/Задания/task1/nikitin/test2.py @@ -1,15 +1,12 @@ from bs4 import BeautifulSoup from selenium import webdriver -from selenium.webdriver import Chrome -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.kinopoisk.ru/list/movies/top250/') +browser.get('https://www.volkswagen.ru/polo/') html_text = browser.page_source soup = BeautifulSoup(html_text, 'lxml') -films=soup.find_all('div', class_='base-movie-main-info_mainInfo__Zl_u3') - -for film in films: - print(film.text) +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 From 796ccce7621c09dc1f1ca42638df471e29f9919a Mon Sep 17 00:00:00 2001 From: ada-dmitry <124861781+ada-dmitry@users.noreply.github.com> Date: Sat, 11 Mar 2023 23:07:06 +0300 Subject: [PATCH 24/35] Update ada.main.py --- Задания/task1/Antipenko/ada.main.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) 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) From 03edd9828b57d5a9ccdba84347c71df63e6423fd Mon Sep 17 00:00:00 2001 From: rus2004 Date: Wed, 15 Mar 2023 22:01:55 +0300 Subject: [PATCH 25/35] =?UTF-8?q?=D0=B3=D0=B0=D0=BD=D1=8C=D0=B3=20=D0=B8?= =?UTF-8?q?=D0=BB=D0=B8=20=D0=B1=D0=B0=D0=BD=D1=8C=D0=B3=20=D0=A1=D0=A5?= =?UTF-8?q?=D0=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/workspace.xml | 11 ++++++++++- Задания/task1/Samigullin/test | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 Задания/task1/Samigullin/test diff --git a/.idea/workspace.xml b/.idea/workspace.xml index de61904..01708a2 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,7 +4,10 @@ - + + + + + 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 From f68ed6060ac955725b13823411b851d7474a98b8 Mon Sep 17 00:00:00 2001 From: rus2004 Date: Wed, 15 Mar 2023 23:46:59 +0300 Subject: [PATCH 26/35] =?UTF-8?q?=D0=A1=D0=B0=D0=BD=D1=8F,=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D0=B8=20=D0=BC=D0=B5=D0=BD=D1=8F=20=D0=BD?= =?UTF-8?q?=D0=B5=D1=85=D0=BE=D1=80=D0=BE=D1=88=D0=B5=D0=B3=D0=BE=20=D1=87?= =?UTF-8?q?=D0=B5=D0=BB=D0=BE=D0=B2=D0=B5=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/workspace.xml | 65 +- main.py | 33 +- Задания/task1/Samigullin/1page1win.py | 856 ++++++++++++++++++++++++++ 3 files changed, 928 insertions(+), 26 deletions(-) create mode 100644 Задания/task1/Samigullin/1page1win.py diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 01708a2..d63945e 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,9 +4,9 @@ - - + + - { + "keyToString": { + "last_opened_file_path": "C:/Users/rusta/c22712", + "settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" } -}]]> - - +} + + + + + + + + + + + + + + + @@ -111,7 +143,14 @@ @@ -131,14 +170,14 @@ - file://$PROJECT_DIR$/main.py - 8 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/Задания/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 From efb779e3eb20b071563754440e80e2216609f071 Mon Sep 17 00:00:00 2001 From: 13danny13 <124861906+13danny13@users.noreply.github.com> Date: Wed, 22 Mar 2023 21:32:22 +0300 Subject: [PATCH 27/35] parcing --- Задания/task1/Kuznetsov/test | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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) From 9e94e914de57a963336aa892619c038434c2ef31 Mon Sep 17 00:00:00 2001 From: 13danny13 <124861906+13danny13@users.noreply.github.com> Date: Wed, 22 Mar 2023 22:06:07 +0300 Subject: [PATCH 28/35] Add files via upload --- Задания/task1/Kuznetsov/parcing.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Задания/task1/Kuznetsov/parcing.py diff --git a/Задания/task1/Kuznetsov/parcing.py b/Задания/task1/Kuznetsov/parcing.py new file mode 100644 index 0000000..932c02c --- /dev/null +++ b/Задания/task1/Kuznetsov/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('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) \ No newline at end of file From 5a13ad4255e3f80b427e0bc0c95da58ff88a0ef0 Mon Sep 17 00:00:00 2001 From: 13danny13 <124861906+13danny13@users.noreply.github.com> Date: Wed, 22 Mar 2023 22:45:38 +0300 Subject: [PATCH 29/35] Update parcing.py --- Задания/task1/Kuznetsov/parcing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Задания/task1/Kuznetsov/parcing.py b/Задания/task1/Kuznetsov/parcing.py index 932c02c..bd717c3 100644 --- a/Задания/task1/Kuznetsov/parcing.py +++ b/Задания/task1/Kuznetsov/parcing.py @@ -8,7 +8,7 @@ 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) +product_name=soup.find_all('a', class_='title') description=soup.find_all('span', class_='description') -print (description[0].text) \ No newline at end of file +for product_name, description in zip(product_name, description): + print(f"Продукт: {product_name.text} \nОписание: {description.text}") From 37038289354c27b3b2229ac74d006b1c176a2bae Mon Sep 17 00:00:00 2001 From: eauskova <124862140+eauskova@users.noreply.github.com> Date: Wed, 22 Mar 2023 23:59:13 +0300 Subject: [PATCH 30/35] Add files via upload --- Задания/task1/Uskova/parcing.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Задания/task1/Uskova/parcing.py 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) From 52019fc29d700961088ee6c8a8a43dcbc037da9e Mon Sep 17 00:00:00 2001 From: 13danny13 Date: Thu, 23 Mar 2023 00:00:32 +0300 Subject: [PATCH 31/35] test change --- Задания/task1/Kuznetsov/parcing.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Задания/task1/Kuznetsov/parcing.py b/Задания/task1/Kuznetsov/parcing.py index bd717c3..0227481 100644 --- a/Задания/task1/Kuznetsov/parcing.py +++ b/Задания/task1/Kuznetsov/parcing.py @@ -12,3 +12,4 @@ 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(" ") From 43414b546182ec64811c56848d50bf319a9de5da Mon Sep 17 00:00:00 2001 From: TatianaFilcheva <124861990+TatianaFilcheva@users.noreply.github.com> Date: Thu, 23 Mar 2023 08:36:57 +0300 Subject: [PATCH 32/35] Add files via upload --- Задания/task1/Filcheva/Verst1.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Задания/task1/Filcheva/Verst1.py 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) From ae1517aed9961b7160025174ceb36a24bbc8f698 Mon Sep 17 00:00:00 2001 From: VladEpifanov <124862300+VladEpifanov@users.noreply.github.com> Date: Thu, 23 Mar 2023 11:09:37 +0300 Subject: [PATCH 33/35] Delete 1-sq.py --- Задания/task1/Epifanov/1-sq.py | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 Задания/task1/Epifanov/1-sq.py diff --git a/Задания/task1/Epifanov/1-sq.py b/Задания/task1/Epifanov/1-sq.py deleted file mode 100644 index 7c3826a..0000000 --- a/Задания/task1/Epifanov/1-sq.py +++ /dev/null @@ -1,13 +0,0 @@ -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.rftoday.ru/_vse_zagolovki2') -html_text = browser.page_source -soup = BeautifulSoup(html_text, 'lxml') -infos = soup.find_all(attrs={"class": "title"}) -#print(infos[0].text) - если нужно вывести только n-ый заголовок -for info in infos: - print(info.text)#Вывод всех заголовков новостей страницы 1 From 0b288e4157942ab750318b32cfff15d67eccd992 Mon Sep 17 00:00:00 2001 From: VladEpifanov Date: Thu, 23 Mar 2023 11:10:52 +0300 Subject: [PATCH 34/35] =?UTF-8?q?=D0=9F=D0=B0=D1=80=D1=81=D0=B8=D0=BD?= =?UTF-8?q?=D0=B3=20=D1=81=D0=B0=D0=B9=D1=82=D0=B0(=D0=B4=D0=B7)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Задания/task1/Epifanov/1 - st hw.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Задания/task1/Epifanov/1 - st hw.py diff --git a/Задания/task1/Epifanov/1 - st hw.py b/Задания/task1/Epifanov/1 - st hw.py new file mode 100644 index 0000000..cb80d35 --- /dev/null +++ b/Задания/task1/Epifanov/1 - st hw.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.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, rev in zip(infos, revs): + print(f"{info.text} ; Источник: {rev.text}")#Вывод всех заголовков новостей и их источников со страницы 1 \ No newline at end of file From fb8952c32fc3a14a4aabed04696c11ffd8e1d556 Mon Sep 17 00:00:00 2001 From: ada-dmitry <124861781+ada-dmitry@users.noreply.github.com> Date: Fri, 24 Mar 2023 10:02:15 +0300 Subject: [PATCH 35/35] Add files via upload --- Задания/task1/Antipenko/DB1.py | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Задания/task1/Antipenko/DB1.py 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