【发布时间】:2021-05-14 06:46:47
【问题描述】:
我想从这个网站打开学生登录: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)
【问题讨论】:
标签: python python-3.x selenium selenium-webdriver webautomation