【问题标题】:SELENIUM PYTHON ElementClickInterceptedException:SELENIUM PYTHON ElementClickInterceptedException:
【发布时间】:2022-08-14 23:58:40
【问题描述】:

我正在编写一个 Selenium Python 脚本。不幸的是,我无法单击“登录”按钮或复选标记。 我尝试了很多方法。如果有人帮助我,我会很高兴。 关联: https://stagingskateontario.memberlounge.ca/auth/login

我的代码:

wait.until(EC.element_to_be_clickable((By.ID, \":r2:\")))
driver.find_element(By.ID,\":r2:\").click()

错误:

selenium.common.exceptions.ElementClickInterceptedException:消息:元素点击被拦截:元素在点(790、723)不可点击 (会话信息:chrome=103.0.5060.134)

enter image description here

标签: python selenium-webdriver mern


【解决方案1】:

我能够用javascript点击按钮 element = browser.find_element_by_xpath("/html/body/div/main/div/div/div[2]/form/button") browser.execute_script("arguments[0].click();", element)

【讨论】:

  • 谢谢,它现在对我有用!你能给我提供更多这种类型的教程文档吗?我想我需要了解更多。
  • 正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center
  • JavaScriptExecutor 是一个通过 Selenium Webdriver 帮助执行 JavaScript 的接口。 JavaScriptExecutor 提供了两种方法“executescript”和“executeAsyncScript”来在选定的窗口或当前页面上运行 javascript。
【解决方案2】:

JavaScriptExecutor 是一个通过 Selenium Webdriver 帮助执行 JavaScript 的接口。 JavaScriptExecutor 提供了两种方法“executescript”和“executeAsyncScript”来在选定的窗口或当前页面上运行 javascript。

【讨论】:

    猜你喜欢
    • 2021-06-15
    • 2020-07-11
    • 2021-11-03
    • 1970-01-01
    • 2020-10-16
    • 2020-09-09
    • 2021-09-13
    • 1970-01-01
    • 2018-07-17
    相关资源
    最近更新 更多