Files
c22712/Задания/task1/Lahin/parsing.py
T
2023-02-16 11:49:57 +03:00

15 lines
523 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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)
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("--------")