Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from selenium.webdriver.support.ui import WebDriverWait
- from selenium.webdriver.common.by import By
- from selenium.webdriver.support import expected_conditions as EC
- from selenium.common.exceptions import StaleElementReferenceException
- import time
- driver.get("https://www.luckia.es/apuestas")
- WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it("sbtechBC"))
- eventos_de_hoy = driver.find_element_by_id("today_event_btn")
- eventos_de_hoy.click()
- ligi_len = len(WebDriverWait(driver, 10).until(EC.presence_of_all_elements_located((By.CLASS_NAME, "leagueWindow "))))
- print(ligi_len)
- for index in range(ligi_len):
- item = WebDriverWait(driver, 10).until(EC.presence_of_all_elements_located((By.CLASS_NAME, "leagueWindow ")))[index]
- driver.execute_script("arguments[0].scrollIntoView(true);", item)
- nume_liga = item.find_element_by_tag_name("h5").text
- time.sleep(3)
- print('try', nume_liga)
- meci = item.find_elements_by_xpath("//*[@class='bets ml']")
- print("there are", len(meci), "in one liga")
Add Comment
Please, Sign In to add comment