python splinter Message: element not interactable

目的:

我想用splinter这个库来实现教务系统的登录

clipboard.png

在填用户的时候成功了,但填密码老是失败

clipboard.png

>>> from splinter import Browser
>>> b = Browser(driver_name='chrome')
>>> url = "http://218.204.129.252:8088/jwglxt/xtgl/login_slogin.html?language=zh_CN&_t=1545575385010"
>>> b.visit(url)
>>> b.fill('yhm','此处为本人学号')
>>>b.fill('mm','密码')
出错信息:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\ClancyZeng\AppData\Local\Programs\Python\Python37-32\lib\site-packages\splinter\driver\webdriver\__init__.py", line 461, in fill
    field.value = value
  File "C:\Users\ClancyZeng\AppData\Local\Programs\Python\Python37-32\lib\site-packages\splinter\driver\webdriver\__init__.py", line 591, in _set_value
    self._element.clear()
  File "C:\Users\ClancyZeng\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 95, in clear
    self._execute(Command.CLEAR_ELEMENT)
  File "C:\Users\ClancyZeng\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute
    return self._parent.execute(command, params)
  File "C:\Users\ClancyZeng\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\ClancyZeng\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: element not interactable
  (Session info: chrome=70.0.3538.110)
  (Driver info: chromedriver=2.45.615291 (ec3682e3c9061c10f26ea9e5cdcf3c53f3f74387),platform=Windows NT 10.0.17134 x86_64)

教务系统网站:http://218.204.129.252:8088/jwglxt/xtgl/login_slogin.html?language=zh_CN&_t=1545575385010

clipboard.png

splinter官方教程:https://splinter-docs-zh-cn.readthedocs.io/zh/latest/tutorial.html

请问该怎么做?

阅读 6.7k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题