I have following html snippet:
<button><span>Next</span></button>
I want to locate this button and I am using the following:
driver.find_element_by_xpath("//button[@span[.='Next']]")
Also used:
driver.find_element_by_xpath("//button//span[.='Next']")
but this locates the span instead of the button :(
But no luck with this. Does anyone know what is the correct way for the same?