Selenium Dynamic Element Python

前端 未结 3 1600
北恋
北恋 2021-01-29 00:12

Hello I am using selenium. I have to send key to this input.

3条回答
  •  离开以前
    2021-01-29 01:09

    You use any of the unique selectors for the input field: type="email" placeholder="E-posta adresi" value="" name="emailAddress" data-componentname="emailAddress"

    xpath:

    driver.find_element_by_xpath("//input[@name='emailAddress' and contains(@placeholder, 'E-posta adresi']")
    

    css:

    driver.find_element_by_css_selector("input[name='emailAddress'][type='email']")
    

提交回复
热议问题