如何使用Selenium (Python)单击此链接



如何在Python中使用Selenium单击此链接?我已经能够得到使用硒的网页,并单击其他链接有id。但是这个没有ID或名称。

<li ng-class="{active: currentTab == 'overview'}">
<a href="#" ng-click="tabDetailsNavigationClick('overview')">
Overview
</a>
</li>

尝试:

WebDriverWait(driver,20).until(EC.element_to_be_clickable((By.XPATH,'//a[contains(.,"Overview")]'))).click()
#imports
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

最新更新