How To Click On The Button When The Textcontext Contains Leading And Trailing White-space Characters?
I'm trying to click on the following button using Selenium with python:
Solution 1:
To invoke click() on the element you need to first use WebDriverWait with expected_conditions for the element to be clickable and you can use the following solution:
Using
XPATH:WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//button[@id='sbmt' and normalize-space()='Einloggen']"))).click()Note : You have to add the following imports :
from selenium.webdriver.support.uiimportWebDriverWaitfrom selenium.webdriver.common.byimportByfrom selenium.webdriver.supportimport expected_conditions asEC
Post a Comment for "How To Click On The Button When The Textcontext Contains Leading And Trailing White-space Characters?"