Is there a way to find an element by attributes in Python Selenium?

后端 未结 3 977
南旧
南旧 2020-11-30 09:42

I got a html snippet like this:



        
3条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-30 10:06

    You can get it by xpath and check the node-type attribute value:

    driver.find_element_by_xpath('//input[@node-type="searchInput"]')
    

提交回复
热议问题