Selenium: is not clickable at point (x, y). Other element would receive the click

  Seves

描述

在selenium中,使用Chromedriver打开网页dr.find_element_by_class_name('J_login_trigger').click()语句能够正常运行,但是,当给Chromedriver设置了--headless后,就出现了如下的错误信息!

错误信息

unknown error: Element is not clickable at point (786, 123). Other element would receive the click: …
(Session info: headless chrome=63.0.3239.132)
(Driver info: chromedriver=2.34.522932 (4140ab217e1ca1bec0c4b4d1b148f3361eb3a03e),platform=Mac OS X 10.13.2 x86_64)

解决方法

替换该行代码:
dr.find_element_by_class_name('J_login_trigger').click()
替换成:
dr.execute_script("$('.J_login_trigger').click()")


文章作者:TuChief
本文链接:http://www.tuchief.com/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明出处!

851