python selenium - Element is not currently interactable and may not be manipulated

前端 未结 6 2011
庸人自扰
庸人自扰 2021-01-17 11:59

I am trying to populate form fields via selenium in python:

from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains

         


        
6条回答
  •  生来不讨喜
    2021-01-17 12:50

    The problem is that there are two other input elements with placeholder="Логин" and placeholder="Пароль" which are invisible. Make your CSS selectors specific to the login form:

    login = driver.find_element_by_css_selector('form#loginForm input[placeholder="Логин"]')
    pwd = driver.find_element_by_css_selector('form#loginForm input[placeholder="Пароль"')
    

提交回复
热议问题