硒异常:元素在该点不可点击 [英] selenium exception: Element is not clickable at point

查看:48
本文介绍了硒异常:元素在该点不可点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将 selenium 升级到最新版本 (2.53),将 firefox 升级到最新版本 (45.0.1).

I have recently upgraded selenium to the latest version (2.53), and firefox to the latest version (45.0.1).

我在同一个网站上运行相同的代码,但突然出现很多这样的异常:

I run the same code on the same websites, but I suddenly have many exceptions like this:

WebDriverException:消息:元素在点 (312,8.816665649414062).其他元素会收到点击:

WebDriverException: Message: Element is not clickable at point (312, 8.816665649414062). Other element would receive the click:

例如:

driver.find_element_by_class_name('my_class_name').click()

有什么我应该注意的新东西吗?我之前的 python selenium 版本相当旧,我使用的是 Firefox 38.

Is there something new that I should be aware of? My previous python selenium version was reasonably old, and I was on firefox 38.

推荐答案

这是我找到的解决方案:

Here's the solution I found:

driver.execute_script("arguments[0].click();", element)

它可以工作,并且可以可靠地点击元素.

It works, and reliably clicks on the element.

这篇关于硒异常:元素在该点不可点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆