mirror of
https://github.com/KUlishevgeniy/c22712.git
synced 2026-09-23 23:50:21 +00:00
Update ada.main.py
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
|
||||||
|
#Вариант с пары
|
||||||
|
'''
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
from selenium.webdriver.chrome.service import Service
|
from selenium.webdriver.chrome.service import Service
|
||||||
@@ -10,9 +13,27 @@ html_text = browser.page_source
|
|||||||
time.sleep(20)
|
time.sleep(20)
|
||||||
soup = BeautifulSoup(html_text, 'lxml')
|
soup = BeautifulSoup(html_text, 'lxml')
|
||||||
films = soup.find_all('div', class_='base-movie-main-info_mainInfo__ZL_u3')
|
films = soup.find_all('div', class_='base-movie-main-info_mainInfo__ZL_u3')
|
||||||
'''
|
|
||||||
print(soup)
|
print(soup)
|
||||||
print(films)
|
print(films)
|
||||||
'''
|
|
||||||
for film in films:
|
for film in films:
|
||||||
print(film.text)
|
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user