gpt4 book ai didi

python - Selenium/Python - 禁用时如何单击按钮?

转载 作者:行者123 更新时间:2023-12-01 08:46:20 25 4
gpt4 key购买 nike

我在点击按钮时遇到问题,它为我返回以下错误消息:

selenium.common.exceptions.WebDriverException: Message: unknown error: Element ... is not clickable at point (1030, 883). Other element would receive the click: (Session info: chrome=70.0.3538.77) (Driver info: chromedriver=2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a),platform=Windows NT 6.1.7601 SP1 x86_64)

这是 HTML:

<a submit="#invoice_form" id="calculate_button" data-type="json" class="rollover button" data-remote="true" rel="nofollow" data-method="post" href="/invoices/40736/calculate" data-disable-on-click="true"><span>Calculate</span></a>

我正在尝试自动化表单,并且所有字段都已填写,当进行计算时我收到了该消息。

下面是我的代码:

driver.find_element_by_id("calculate_button").click()

最佳答案

弄清楚并且现在正在工作。这是我使用的代码。基本上我需要添加一段时间来等待临时覆盖消失,然后再尝试单击。

 cal_wait = WebDriverWait(driver, 10)
cal_wait.until(EC.invisibility_of_element_located((By.XPATH,"//div[@class='blockUI
blockOverlay']")))
driver.find_element_by_id("calculate_button").click()

关于python - Selenium/Python - 禁用时如何单击按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53292018/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com