linktext

Selenium unable to locate button

Selenium unable to locate button Question: I am trying to click a button on a website in Python using Selenium. The html looks like this: <a class="btn btn-default btn-lg primary-light-blue-btn" onclick="createReport()">Create report</a> I have tried using: l = driver.find_element(By.XPATH, "//button[@class=’btn btn-default btn-lg primary-light-blue-btn’]") But I get the error: NoSuchElementException: no such element: Unable to locate …

Total answers: 2