Even if the <button>
tag does not have a name
attribute, you can still utilize other attributes like class
, innerText
, and more.
In order to trigger a click()
action on the element containing the text Enter, you must employ WebDriverWait to wait for the element to become clickable(), and you can opt for one of these Locator Strategies:
Using Python with CSS_SELECTOR
:
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "button.xButton.xCTA.xSubmit[type='submit'] > span"))).click()
Employing Java along with XPATH
:
new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.xpath("//button[@class='xButton xCTA xSubmit']/span[text()='Enter']"))).click();