Как запарсить весь сайт через BeautifulSoup, если парситься только первая страничка, а для перехода и парсинга другой нужно нажать кнопку прокрутки. Но в BeautifulSoup нет функции клик. Предлагают применить selenium, но куда и какой код нужно вставить не понимаю.
from bs4 import BeautifulSoup
import requests
import lxml
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.common.exceptions import WebDriverException
browser = webdriver.Chrome()
browser.set_window_size(1024, 600)
browser.maximize_window()
url = 'https://telega.in/catalog'
res = requests.get(url)
soup = BeautifulSoup(res.text, 'lxml')
name = soup.find_all('span', class_="font-18px desck bold channel_title")
for name in name:
print(name.text)
Description = soup.find_all('div', class_="info-description font-16px desck lh-18px color-light_black")
for Description in Description:
print(Description.text)
Subscribers = soup.find_all('span', class_="font-18px desck color-headline")
for Subscribers in Subscribers:
print(Subscribers.text)
er = soup.find_all('span', class_="font-18px desck color-headline js-err")
for er in er:
print(er.text)
Views = soup.find_all('span', class_="font-18px desck color-headline js-view")
for Views in Views:
print(Views.text)
Categories = soup.find_all('div', class_="info-subject font-12px desck color-caprion")
for Categories in Categories:
print(Categories.text)
Price_for_one_number_of_placements = soup.find_all('div', class_="current_price text_price js-price")
for Price_for_one_number_of_placements in Price_for_one_number_of_placements:
print(Price_for_one_number_of_placements.text)