selenium.common.exceptions.ElementClickInterceptedException:

selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable with Selenium and Python(selenium.common.exceptions.ElementClickInterceptedException:消息:元素点击被拦截:元素不可点击
本文介绍了selenium.common.exceptions.ElementClickInterceptedException:消息:元素点击被拦截:元素不可点击 Selenium 和 Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我目前正在从事一个自动填写表格的项目.填写表格时会出现下一个按钮,这就是它给我一个错误的原因.

I am currently working on a project which fills a form automatically. And the next button appears when the form is filled, that's why it gives me an error.

我试过了:

WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH,"//input[@type='button' and @class='button']")))
Next = driver.find_element_by_xpath("//input[@type='button' and @class='button']")
Next.click()

HTML:

<span class="btn">
    <input type="button" value="Next" class="button" payoneer="Button" data-controltovalidate="PersonalDetails" data-onfieldsvalidation="ToggleNextButton" data-onclick="UpdateServerWithCurrentSection();" id="PersonalDetailsButton">
     </input>
     <div class="clearfix"></div>
</span>

错误:

selenium.common.exceptions.ElementClickInterceptedException:消息:元素点击被拦截:元素在点 (203, 530) 处不可点击.其他元素会收到点击:... (Session info: chrome=76.0.3809.132)

selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (203, 530). Other element would receive the click: ... (Session info: chrome=76.0.3809.132)

推荐答案

如果xpath的路径是对的,或许你可以试试这个方法来解决这个问题.将旧代码替换为以下代码:

If the path of the xpath is right, maybe you can try this method to solve this problem. Replace the old code with the following code:

button = driver.find_element_by_xpath("xpath")
driver.execute_script("arguments[0].click();", button)

我以前解决过这个问题,但老实说,我不知道原因.

I solved this problem before, but to be honestly, I don't know the reason.

这篇关于selenium.common.exceptions.ElementClickInterceptedException:消息:元素点击被拦截:元素不可点击 Selenium 和 Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to find element by part of its id name in selenium with python(如何使用python在selenium中通过其id名称的一部分查找元素)
NoSuchElementException: Message: Unable to locate element while trying to click on the button VISA through Selenium and Python(NoSuchElementException:消息:尝试通过 Selenium 和 Python 单击 VISA 按钮时无法找到元素) - IT屋-程序员软件开发技术分
Selenium not able to click on Get Data button on using Python(Selenium 在使用 Python 时无法单击“获取数据按钮)
Selenium Compound class names not permitted(不允许使用硒化合物类名称)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element while trying to click Next button with selenium(selenium.common.exceptions.NoSuchElementException:消息:没有这样的元素:尝试使用 selenium 单
Get original filename google app engine(获取原始文件名 google app engine)