Selenium WebDriverWait,但仍然"Element is not clickable at point"



我有以下代码(br是web驱动程序,一切都导入得很好)。

前3行运行良好,但链接1.click()仍然给我一个错误:

link = WebDriverWait(br, 30).until(EC.element_to_be_clickable((By.ID, "buttonNew Project")))
link.click()    
link1 = WebDriverWait(br, 30).until(EC.element_to_be_clickable((By.ID, "MP")))
link1.click()

即使它应该等到它可以点击,我仍然得到了错误:

WebDriverException: unknown error: Element is not clickable at point (543, 170). Other element would receive the click: <div id="screenBlocker" style="width: 1920px; height: 979px; display: block; background-position: 940px 420px;"></div>
  (Session info: chrome=49.0.2623.108)
  (Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 6.1 SP1 x86_64)(543, 170)

其他元素将收到点击:<div id="screenBlocker" st...

screenBlocker听起来确实像一个屏幕屏蔽器。你在页面顶部有一个弹出/覆盖,你需要关闭它,使其不可见。

如果没有可见的"关闭"按钮,只需通过以下方式使其不可见:

blocker = driver.find_element_by_id("screenBlocker")
driver.execute_script("arguments[0].style = {display: 'none'};", blocker)

最新更新