-1

Having some trouble selecting the input on a form on the instagram page using find_elements_by_xpath.

The source HTML code looks like this: HTML Code from Page

And this is the code that I'm using, but getting no results when printing the result in console.

inputs = browser.find_elements_by_xpath('//form/div[2]/div/div/input')
ErFran
  • 1
  • 3

1 Answers1

0

You can get information how to use locators here: official-locator-strategies-for-the-webdriver.

You can also need to learn about Explicit and Implicit Waits.

Input has name attribute with value username, xpath:

inputs = browser.find_elements_by_xpath("//input[@name='username']")

Find elements by name:

inputs = browser.find_elements_by_name("username")
Sers
  • 12,047
  • 2
  • 12
  • 31