I am trying to click on a span class located inside a div class. Here's the HTML:
<div class="modal-content scrollbar">
<div class="block block-always-show action-black-box waves-effect">
<div class="icon xray-icon"></div>
<span class="txt">Xray - Test Product Research</span>
</div>
Still learning Selenium but here's what I've tried:
driver.find_element_by_xpath("//span[contains(@class, txt) and contains(text()='Xray - Test Product Research')]").click()
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//span[text()='Xray - Test Product Research']"))).click()
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//span[@class='txt' and contains(.,'Xray - Test Product Research')]"))).click()
I am getting these errors:
NoSuchElementException: Message: no such element: Unable to locate element:
and
TimeoutException: Message:
Thanks in advance and appreciate any help on a solution.