D:\software\python3\python.exe C:\Users\h220406010\AppData\Roaming\JetBrains\IntelliJIdea2021.1\plugins\python\helpers\pydev\pydevd.py --multiproc --qt-support=auto --client 127.0.0.1 --port 52944 --file E:/myworkspace/nanxiuzi_learn/baserocks/python/Selenium/test_login.py
C:\Users\h220406010\AppData\Roaming\JetBrains\IntelliJIdea2021.1\plugins\python\helpers\pydev\pydevd.py:1844: DeprecationWarning: currentThread() is deprecated, use current_thread() instead
dummy_thread = threading.currentThread()
Connected to pydev debugger (build 211.7442.40)
E:/myworkspace/nanxiuzi_learn/baserocks/python/Selenium/test_login.py:31: DeprecationWarning: use options instead of chrome_options
self.driver = webdriver.Chrome(chrome_options=chrome_options)
INFO:root:滑块验证,尝试第 1 次
ERROR:root:登录成功了
INFO:root:恭喜铁子,登录成功,页面跳转中
该元素是否显示:False
Traceback (most recent call last):
File "E:/myworkspace/nanxiuzi_learn/baserocks/python/Selenium/test_login.py", line 183, in <module>
login.test_login()
File "E:/myworkspace/nanxiuzi_learn/baserocks/python/Selenium/test_login.py", line 156, in test_login
ele.click()
File "D:\software\python3\lib\site-packages\selenium\webdriver\remote\webelement.py", line 81, in click
self._execute(Command.CLICK_ELEMENT)
File "D:\software\python3\lib\site-packages\selenium\webdriver\remote\webelement.py", line 740, in _execute
return self._parent.execute(command, params)
File "D:\software\python3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 430, in execute
self.error_handler.check_response(response)
File "D:\software\python3\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
(Session info: chrome=100.0.4896.88)
Stacktrace:
Backtrace:
Ordinal0 [0x00927413+2389011]
Ordinal0 [0x008B9F61+1941345]
Ordinal0 [0x007AC520+836896]
Ordinal0 [0x007DA1F3+1024499]
Ordinal0 [0x007CFF93+982931]
Ordinal0 [0x007F414C+1130828]
Ordinal0 [0x007CF974+981364]
Ordinal0 [0x007F4364+1131364]
Ordinal0 [0x00804302+1196802]
Ordinal0 [0x007F3F66+1130342]
Ordinal0 [0x007CE546+976198]
Ordinal0 [0x007CF456+980054]
GetHandleVerifier [0x00AD9632+1727522]
GetHandleVerifier [0x00B8BA4D+2457661]
GetHandleVerifier [0x009BEB81+569713]
GetHandleVerifier [0x009BDD76+566118]
Ordinal0 [0x008C0B2B+1968939]
Ordinal0 [0x008C5988+1989000]
Ordinal0 [0x008C5A75+1989237]
Ordinal0 [0x008CECB1+2026673]
BaseThreadInitThunk [0x766BFA29+25]
RtlGetAppContainerNamedObjectPath [0x773C7A7E+286]
RtlGetAppContainerNamedObjectPath [0x773C7A4E+238]
Process finished with exit code 1
错误内容:元素没有交互能力
报错行:ele.click()
原因:这个是Div ,不拥有点击事件
解决办法:
self.driver.execute_script("arguments[0].click();", ele.find_elements(by=By.XPATH,value='./*')[0])
|