Reputation: 203
I have a script written and have been able to code for buttons that have html but this button that I inspected on this link, doesn't have one.
This is the element for the login button.
<input type="submit" value="login" class="button">
How would I write this line of script to click on this button using selenium & python?
Upvotes: 0
Views: 701
Reputation: 1925
your element has few attributes, which we can use. Try to find an element which starts with input and has an attribute type='submit'
driver.find_element_by_xpath("//div[@class='content']//input[@type='submit']").click()
Upvotes: 0
Reputation: 193388
To click on the button with text as Login you can use the following line of code :
browser.find_element_by_xpath("//form[@method='post' and @action='/auth/login/']//input[@class='button' and @value='login']").click()
#or
browser.find_element_by_xpath("//form[@method='post' and @action='/auth/login/']//input[@class='button' and @value='login']").submit()
Upvotes: 1