![](/img/trans.png)
[英]can anyone help me in resolving the error which I am getting while running this tensorflow program
[英]I am getting error while running this python code. The error is “ElementNotInteractableException”. Can any on help me out?
我想從這個網站打開學生登錄: https://exams.mlrinstitutions.ac.in/打開網站-->點擊“登錄”-->點擊“學生登錄”
此代碼在打開並單擊登錄之前都可以正常工作。 但是當代碼點擊“學生登錄”時,它會遇到錯誤。
對於 HTML 代碼,請打開網頁並使用檢查元素。
代碼
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
path = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(executable_path=path)
driver.get("https://exams.mlrinstitutions.ac.in/")
first = WebDriverWait(driver, 60).until(
EC.presence_of_element_located((By.ID, "lnkLogins"))
)
first.click()
first = WebDriverWait(driver, 60).until(
EC.presence_of_element_located((By.ID, "lnkStudent"))
)
first.click()
錯誤
DevTools listening on ws://127.0.0.1:55873/devtools/browser/0977ccf6-90ba-4f79-b746-e8ff53bd4035
Traceback (most recent call last):
File "c:\Users\dile2\OneDrive\Desktop\mini\sel.py", line 19, in <module>
first.click()
File "C:\Users\dile2\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click
self._execute(Command.CLICK_ELEMENT)
File "C:\Users\dile2\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute
return self._parent.execute(command, params)
[13984:14080:0210/201137.350:ERROR:device_event_log_impl.cc(211)] [20:11:37.349] USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
File "C:\Users\dile2\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\dile2\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
(Session info: chrome=88.0.4324.150)
而不是 present_of_element_located( presence_of_element_located()
使用element_to_be_clickable()
driver.get("https://exams.mlrinstitutions.ac.in/")
first = WebDriverWait(driver, 60).until(EC.element_to_be_clickable((By.ID, "lnkLogins")))
first.click()
first = WebDriverWait(driver, 60).until(EC.element_to_be_clickable((By.ID, "lnkStudent")))
first.click()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.