0

I'm struggling to figure a way to click the submit button in the following class. It does not contain an ID, name, or any easily identifiable method that is not dynamically generated. any help is appreciated.

so far i have tried:

driver.find_element_by_xpath("//div[@class='button-status-container'][@type='submit']")

driver.find_element_by_xpath("//div[@class='button-status-container']//button-status-container[@type='submit']")

driver.find_element_by_css_selector('.button-status-container[type="button"]')

all of the above errors out with NoSuchElementException. the htlm of submit button

Grasshopper
  • 8,908
  • 2
  • 17
  • 32
remis4
  • 5
  • 3
  • try following xpath: '//div/button[contains(text(), 'Register')]' – Poloq Dec 04 '16 at 03:26
  • Can you provide bigger part of html on that page for verification ? In text - not screenshot. – pagep Dec 04 '16 at 13:34
  • @Poloq you solution worked, i had to find all elements with 'Register', append to list, and select the correct one: register_button = driver.find_elements_by_xpath("//*[contains(text(), 'Register')]") register_button[2].click() – remis4 Dec 05 '16 at 02:47

1 Answers1

0

I think the correct xpath/css selector should be:

driver.find_element_by_xpath("//div[@class='button-status-container']/button[@type='submit']")

driver.find_element_by_css_selector('.button-status-container > [type="button"]')
Linh Nguyen
  • 1,120
  • 7
  • 13