小编典典

Selenium-Debugging:元素在(X,Y)点不可点击

selenium

我尝试用Selenium 抓取此网站

我想单击“下一页”按钮,为此,我这样做:

 driver.find_element_by_class_name('pagination-r').click()

它适用于许多页面,但不适用于所有页面,我收到此错误

WebDriverException: Message: Element is not clickable at point (918, 13). Other element would receive the click: <div class="linkAuchan"></div>

始终为此页面

我尝试了这个

driver.implicitly_wait(10)
el = driver.find_element_by_class_name('pagination-r')
action = webdriver.common.action_chains.ActionChains(driver)
action.move_to_element_with_offset(el, 918, 13)
action.click()
action.perform()

但是我遇到了同样的错误


阅读 319

收藏
2020-06-26

共1个答案

小编典典

另一个元素覆盖了您要单击的元素。您可以使用它execute_script()来单击。

element = driver.find_element_by_class_name('pagination-r')
driver.execute_script("arguments[0].click();", element)
2020-06-26