Home > Software design >  How to find selector for this HTML snippet
How to find selector for this HTML snippet

Time:10-20

How to find selector from this? I want to click the button but unable to find selector.it will be a css selector or class selector.

HTML

<button data-bb-handler="confirm" type="button" >Continue and Logout Other User</button>

CodePudding user response:

You can try it

button_Login = driver.find_element_by_css_selector("#button").text("Continue and Logout Other User")

CodePudding user response:

Make sure the button is visible when you try to click it. The following selectors should work:

.btn-succes 
//button[@class='btn btn-succes']

CodePudding user response:

You can use the following selectors -

driver.find_element(By.CSS_SELECTOR,'button.btn.btn-success')

driver.find_element(By.CSS_SELECTOR, 'button[class='btn btn-success']')

driver.find_element(By.XPATH, "//button[normalize-space()='Continue and Logout Other User']")
  • Related