I need to loop trough elements of a webpage and scrap data from each of the elements, but the webelements keep refreshing every 25 sec and my code does not finish iterating all elements in that amount of time, after that moment i get the element is not attached to the page document error:
driver.get("https://www.luckia.es/apuestas")
time.sleep(5)
driver.switch_to.frame("sbtechBC")
eventos_de_hoy=driver.find_element_by_id("today_event_btn")
eventos_de_hoy.click()
time.sleep(7)
ligi = driver.find_elements_by_class_name("leagueWindow ")
print(len(ligi))
for items in ligi:
driver.execute_script("arguments[0].scrollIntoView(true);", items)
nume_liga= items.find_element_by_tag_name("h5")
print(nume_liga.text)
I am fresh all out of ideas.