Selenium 调试:元素在 (X,Y) 点不可点击 [英] Selenium-Debugging: Element is not clickable at point (X,Y)
本文介绍了Selenium 调试:元素在 (X,Y) 点不可点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试通过 Selenium 抓取这个网站.
I try to scrape this site by Selenium.
我想点击下一页"按钮,为此我这样做:
I want to click in "Next Page" buttom, for this I do:
driver.find_element_by_class_name('pagination-r').click()
它适用于许多页面但不适用于所有页面,我收到此错误
it works for many pages but not for all, I got this error
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()
但我遇到了同样的错误
推荐答案
另一个元素覆盖了您尝试单击的元素.您可以使用 execute_script()
来点击它.
Another element is covering the element you are trying to click. You could use execute_script()
to click on this.
element = driver.find_element_by_class_name('pagination-r')
driver.execute_script("arguments[0].click();", element)
这篇关于Selenium 调试:元素在 (X,Y) 点不可点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文