Why would selenium not find the element using xpath
?
<input class="btn btn-success" name="submit" id="loginButton" accesskey="l" value="Login" tabindex="6" type="submit">
使用:
driver.find_element_by_xpath("//input[@class='btn btn-success']").click()
我得到:
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: //input[@class='btn btn-success']
也尝试过CSS选择器
尝试显式等待。
尝试其他属性
driver.find_element_by_xpath(“ // input [@ id ='loginButton']”)。click()