python selenium模拟登录时报错 Message: element not interactable
在使用selenium模拟登录学校教务系统网站时,可以输入用户名,但输入密码时会报错,账号框和密码框在网站上结构是相似的,直接运行会报错,调试就可以输入
```
Traceback (most recent call last):
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
(Session info: chrome=75.0.3770.100)
(Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Mac OS X 10.14.2 x86_64)
```
以下是我的代码:
```
from selenium import webdriver
import time
web = webdriver.Chrome()
try:
def rate():
url = 'http://jwgl.baiyunu.edu.cn/home.aspx'
web.get(url)
time.sleep(5)
web.switch_to.frame('frm_login')
web.find_element_by_id("txt_asmcdefsddsd").send_keys('12345678')
pwd = web.find_element_by_id("txt_psasas")
time.sleep(1)
pwd.send_keys('12345')
time.sleep(10)
rate()
finally:
web.quit()
```
各位大佬能否解答一下 谢谢