Reputation: 43
I have been trying to use selenium python to click the continue button in Login Page from the below link.
I have tried several selectors, xpath..nothing seems working for me.
This is the element I am trying to click on:
driver.find_element_by_xpath("//span[text()='Continue']").click()
Tried with Div class too:
driver.find_element_by_xpath("//div[contains(@class, 'appendBottom25 ')]")
I expect the selenium to click the continue button and to load to the password page
Upvotes: 1
Views: 6605
Reputation: 1042
I think you should click on "button".
Try to use xpath below:
//button[./span[text()='Continue']]
And use explicit wait to wait element to be clickable.
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//button[./span[text()='Continue']]"))).click()
Upvotes: 0
Reputation: 2770
You are using right xpath
Solution :
perform the click operation twice :
element =driver.find_element_by_xpath("//span[text()='Continue']")
element.click()
element.click()
It is a strange solution but .. I got solved this problem same way only.
Upvotes: 3
Reputation: 746
try this one:
driver.find_element_by_xpath("//*[@id="SW"]/div[2]/div[2]/div[2]/section/form/div[2]/button/span").click()
if you choose to find element by xpath you have to pass as argument the xpath. (you right-click on the continue button > inspect
> and then right click on the elemnt that marked > copy xpath
)
Upvotes: 0