Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 尝试自动化浏览器时Selenium中的ElementNotInteractiableException_Python_Selenium_Firefox_Exception_Browser - Fatal编程技术网

Python 尝试自动化浏览器时Selenium中的ElementNotInteractiableException

Python 尝试自动化浏览器时Selenium中的ElementNotInteractiableException,python,selenium,firefox,exception,browser,Python,Selenium,Firefox,Exception,Browser,当我试图在给定字段中输入时,我得到一个错误 selenium.common.exceptions.ElementNotInteractableException: Message: Element <input class="text-input email-input js-signin-email" name="session[username_or_email]" type="text"> is not reachable by keyboard selenium.commo

当我试图在给定字段中输入时,我得到一个错误

selenium.common.exceptions.ElementNotInteractableException: Message: Element <input class="text-input email-input js-signin-email" name="session[username_or_email]" type="text"> is not reachable by keyboard
selenium.common.exceptions.elementnotinteractiableexception:消息:键盘无法访问元素

我尝试将计时器.sleep()从10秒增加到15秒。我找不到修复程序。

改用显式等待:

from selenium.webdriver.support import ui
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By


input_filed = ui.WebDriverWait(driver, 10).until(
    EC.element_to_be_clickable((By.CSS_SELECTOR, "input.text-input.email-input.js-signin-email")))
# Do actions with input element.
希望它能帮助你