小编jat*_*rna的帖子

selenium.common.exceptions.ElementNotInteractableException:消息:尝试使用 Selenium 和 Python 登录时元素不可交互错误

我正在尝试https://www.ecobolsa.com/index.html在 python3中使用 Selenium登录,但是 send_keys 函数给了我消息:

selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
(Session info: headless chrome=78.0.3904.97)
Run Code Online (Sandbox Code Playgroud)

代码是:

from selenium.webdriver.chrome.options import Options
from selenium import webdriver

options = Options()
options.add_argument('--headless')
options.add_argument('--disable-gpu')
options.add_argument("start-maximized")
options.add_argument("disable-infobars")
options.add_argument("--disable-extensions")

email = 'fake@gmail.com'
password = 'fakepass3'

driver = webdriver.Chrome('chromedriver', options=options)

driver.get('https://www.ecobolsa.com/index.html')

driver.find_element_by_id("userNameTextBox").send_keys(email)
driver.find_element_by_id("password_login").send_keys(password)
Run Code Online (Sandbox Code Playgroud)

我尝试了其他解决方案,但没有一个成功。我需要帮助。

selenium python-3.x selenium-chromedriver selenium-webdriver webdriverwait

3
推荐指数
1
解决办法
989
查看次数