В один момент мой код должен найти элемент и 'перейти' по нему что бы найти новые мне нужные элементы
(кому нужно вот код):
from bs4 import BeautifulSoup as BS
import requests
import lxml
from selenium import webdriver
import time
import selenium.webdriver.support.ui as ui
#parsing
def get_data(url, urls):
#autologin
driver = webdriver.Chrome(r"C:\Users\Lenovo\Downloads\chromedriver.exe")
driver.get(url)
driver.implicitly_wait(1000)
driver.maximize_window()
email_and_password = driver.find_elements_by_class_name('styles__input___2XTSp-camelCase')
email = email_and_password[0]
email.send_keys('raziza7757.14@gmail.com')
password = email_and_password[1]
password.send_keys('7757Tit67')
nextBtn = driver.find_element_by_class_name('styles__button___2hNZo-camelCase')
nextBtn.click()
driver.get(urls)
blooks_information = []
overall = driver.find_elements_by_class_name('styles__blookContainer___3JrKb-camelCase')
print(overall)
req = requests.get(urls)
print(req)
with open('another.html', 'w') as file:
file.write(req.text)
soup = BS(req.text, 'lxml')
for blooks in overall :
blooks.click()
name_of_blook = driver.find_element_by_class_name('styles__input___2XTSp-camelCase')
print(name_of_blook)
rarity_of_blook = soup.find('div', class_='styles__highlightedRarity___1EXx_-camelCase').text()
blooks_information.append(name_of_blook)
blooks_information.append(rarity_of_blook)
print(get_data('https://dashboard.blooket.com/login', 'https://dashboard.blooket.com/blooks'))
Суть можно посмотреть здесь :
https://qna.habr.com/q/1197752?e=13037018#clarific...