click button in python selenium

Question:

html codemy code
how can click buton in this html code im using selenium.

I’m trying to writing a loop in my admin panel.

Asked By: phantompain

||

Answers:

first off that button does not have an id='button'

without seeing the website you could try do something like:

login_button = driver.find_element(By.TAG_NAME, 'button')
login_button.click() # this assumes that there are no other buttons on the page as find_element finds the first button on the page

OR

login_button = driver.find_element(By.CLASS_NAME, 'btn')
login_button.click() # this assumes that there are no other elements with the `btn` class to click
Answered By: Andrew Ryan