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

前端 未结 6 1961
庸人自扰
庸人自扰 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:28

    Here xpath selectors working.

    login = driver.find_element_by_xpath('//*[@id=\'loginForm\']/div/div[1]/input')
    pwd = driver.find_element_by_xpath('//*[@id=\'loginForm\']/div/div[2]/input')
    

    or same but css selector

    login = driver.find_element_by_css_selector('form#loginForm [name="data[User][login]"]')
    pwd = driver.find_element_by_css_selector('form#loginForm [name="data[User][password]"]')
    

提交回复
热议问题