Python 使用 selenium:无法定位真正存在的元素

Python with selenium: unable to locate element which really exists

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

未找到该元素(while 循环被怀疑),我尝试添加一个计时器

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

还是无法让selenium识别元素。我不认为我在源代码中看到任何看起来像 iframe 的东西(我可能错过了)。

代替 you need to induce WebDriverWait for the and you can use the following

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