0
from selenium import webdriver
chromedriver = 'C:\\chromedriver.exe'
browser = webdriver.Chrome(chromedriver)
browser.get('http://www.example.com')

Then, how can I click on the third Download button?

2964502
  • 4,301
  • 12
  • 35
  • 55

1 Answers1

1

You can use a xpath expresion to get all inputs with a "Download" value, and click the third:

browser.find_elements_by_xpath('//input[@value="Download"]')[2].click()
Krzysztof Rosiński
  • 1,488
  • 1
  • 11
  • 24
  • thank you so much. You may be interested in my next question too: http://stackoverflow.com/questions/21186327/fill-username-and-password-using-selenium-in-python @Krzysztof Rosiński – 2964502 Jan 17 '14 at 12:44