Search code examples
seleniumfindelementangular-ngmodel

How can I address "ng-model" attribute to find elements on a web page?


I am trying to use Selenium, and the only thing that I found in some elements to address is their ng-model = "something" attribute. But I don't know how to address them in the following code?

driver = webdriver.Chrome("chromedriver.exe")
search = driver.find_element_by_('')

Solution

  • You can use XPath Locator like:

    search = driver.find_element_by_xpath("//*[@ng-model='something']")
    

    More information: