selenium.common.exceptions.ElementNotInteractableException:消息:元素不可交互+蓝牙适配器错误

时间:2020-11-08 17:08:36

标签: python selenium selenium-webdriver

我遇到此错误

  File "C:\Users\samsshow\Desktop\microsoft-teams-class-attender-main (1)\microsoft-teams-class-attender-main\bot.py", line 252, in sched
    start_browser()
  File "C:\Users\samsshow\Desktop\microsoft-teams-class-attender-main (1)\microsoft-teams-class-attender-main\bot.py", line 214, in start_browser
    login()
  File "C:\Users\samsshow\Desktop\microsoft-teams-class-attender-main (1)\microsoft-teams-class-attender-main\bot.py", line 45, in login
    driver.find_element_by_xpath('//*[@id="idSIButton9"]').click() #Next button
  File "C:\Users\samsshow\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click
    self._execute(Command.CLICK_ELEMENT)
  File "C:\Users\samsshow\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\samsshow\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\samsshow\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.ElementNotInteractableException: Message: element not interactable

我的代码

def login():
    global driver
    #login required
    print("logging in")
    emailField = driver.find_element_by_xpath('//*[@id="i0116"]')
    emailField.click()
    emailField.send_keys(CREDS['email'])
    driver.find_element_by_xpath('//*[@id="idSIButton9"]').click() #Next button
    time.sleep(5)
    passwordField = driver.find_element_by_xpath('//*[@id="i0118"]')
    passwordField.click()
    passwordField.send_keys(CREDS['passwd'])
    driver.find_element_by_xpath('//*[@id="idSIButton9"]').click() #Sign in button
    time.sleep(5)
    driver.find_element_by_xpath('//*[@id="idSIButton9"]').click() #remember login
    time.sleep(5)
    # return driver

0 个答案:

没有答案