专注于 JetBrains IDEA 全家桶,永久激活,教程
持续更新 PyCharm,IDEA,WebStorm,PhpStorm,DataGrip,RubyMine,CLion,AppCode 永久激活教程

Selenium报:selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable的解决方法

最近用selenium+python写代码新建了一个文件夹

在文件夹中书写.py文件时代码在同事电脑上走通没有问题

自己电脑经常报:selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable

报错如下:

C:\Users\EDZ\Desktop\selenium_demo\venv\Scripts\python.exe C:/Users/EDZ/Desktop/selenium_demo/webdriver/Alret.py
Traceback (most recent call last):
  File "C:/Users/EDZ/Desktop/selenium_demo/webdriver/Alret.py", line 26, in <module>
    driver.find_element_by_class_name('setpref').click() #通过class定位到搜索升设置
  File "C:\Users\EDZ\Desktop\selenium_demo\venv\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click
    self._execute(Command.CLICK_ELEMENT)
  File "C:\Users\EDZ\Desktop\selenium_demo\venv\lib\site-packages\selenium\webdriver\remote\webelement.py", line 672, in _execute
    return self._parent.execute(command, params)
  File "C:\Users\EDZ\Desktop\selenium_demo\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 318, in execute
    self.error_handler.check_response(response)
  File "C:\Users\EDZ\Desktop\selenium_demo\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 240, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
  (Session info: chrome=84.0.4147.105)
Stacktrace:
Backtrace:
    Ordinal0 [0x01189563+2725219]
    Ordinal0 [0x01088551+1672529]
    Ordinal0 [0x00F70202+524802]
    Ordinal0 [0x00F0A0BA+106682]
    Ordinal0 [0x00F043B1+82865]
    Ordinal0 [0x00F1AA9D+174749]
    Ordinal0 [0x00F041F6+82422]
    Ordinal0 [0x00F1ACE1+175329]
    Ordinal0 [0x00F23D7C+212348]
    Ordinal0 [0x00F1A94B+174411]
    Ordinal0 [0x00F02528+75048]
    Ordinal0 [0x00F035A0+79264]
    Ordinal0 [0x00F03539+79161]
    Ordinal0 [0x0109D607+1758727]
    GetHandleVerifier [0x012A6546+1050150]
    GetHandleVerifier [0x012A6291+1049457]
    GetHandleVerifier [0x012B10D7+1094071]
    GetHandleVerifier [0x012A6B46+1051686]
    Ordinal0 [0x01095B06+1727238]
    Ordinal0 [0x0109EB7B+1764219]
    Ordinal0 [0x0109ECE3+1764579]
    Ordinal0 [0x010B4C05+1854469]
    BaseThreadInitThunk [0x777C6359+25]
    RtlGetAppContainerNamedObjectPath [0x77B67C24+228]
    RtlGetAppContainerNamedObjectPath [0x77B67BF4+180]

通过大佬指点,应该是链接超时问题

解决方法,为了保证程序和链接的稳定性,在.py所在的文件夹中上传chromedriver文件

如下图:

120_1.png

重新执行代码就不报错了!

120_2.png

以上如果有问题随时沟通。

感谢!

文章永久链接:https://tech.souyunku.com/45896

未经允许不得转载:搜云库技术团队 » Selenium报:selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable的解决方法

JetBrains 全家桶,激活、破解、教程

提供 JetBrains 全家桶激活码、注册码、破解补丁下载及详细激活教程,支持 IntelliJ IDEA、PyCharm、WebStorm 等工具的永久激活。无论是破解教程,还是最新激活码,均可免费获得,帮助开发者解决常见激活问题,确保轻松破解并快速使用 JetBrains 软件。获取免费的破解补丁和激活码,快速解决激活难题,全面覆盖 2024/2025 版本!

联系我们联系我们