Home > other >  Python with selenium: unable to locate element which really exists
Python with selenium: unable to locate element which really exists

Time:02-24

while len(driver.find_elements(By.XPATH,"//*[@title='Next page']"))!=0:

The element is not found (and the while loop skept), I tried adding a timer

ui.WebDriverWait(driver, 5).until(EC.presence_of_element_located((By.XPATH,"//*[@title='Next Page']")))

Still impossible to make selenium recognize the element. I don't think I saw anything that looked like an iframe on the source (I might have missed it).

CodePudding user response:

Instead of presence_of_element_located() you need to induce WebDriverWait for the element_to_be_clickable() and you can use the following locator strategy:

ui.WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH,"//*[@title='Next Page']"))).click()

CodePudding user response:

Can you share the url and the element which you wanna find?

  • Related