我目前正在从事一个自动填写表格的项目.填写表格时会出现下一个按钮,这就是它给我一个错误的原因.
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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何在python中的感兴趣区域周围绘制一个矩形How to draw a rectangle around a region of interest in python(如何在python中的感兴趣区域周围绘制一个矩形)
如何使用 OpenCV 检测和跟踪人员?How can I detect and track people using OpenCV?(如何使用 OpenCV 检测和跟踪人员?)
如何在图像的多个矩形边界框中应用阈值?How to apply threshold within multiple rectangular bounding boxes in an image?(如何在图像的多个矩形边界框中应用阈值?)
如何下载 Coco Dataset 的特定部分?How can I download a specific part of Coco Dataset?(如何下载 Coco Dataset 的特定部分?)
根据文本方向检测图像方向角度Detect image orientation angle based on text direction(根据文本方向检测图像方向角度)
使用 Opencv 检测图像中矩形的中心和角度Detect centre and angle of rectangles in an image using Opencv(使用 Opencv 检测图像中矩形的中心和角度)