如何点击 href link?

How do I click on the href link?

我已经尝试使用 driver.find_element_by_id // link_text // 部分 link 文本,我应该使用什么来访问此 href。我得到了没有这样的元素异常。 tysm 将不胜感激。

    
<a href="../s-reminderNotice.asp?fname=b%2D3c%2DpLessonBooking%2Easp%3Flimit%3Dpl" 
class="sidelinkbold" target="mainFrame" onmouseover=" 
window.status='Practical Training Booking'; return true" onmouseout="window.status=' '; 
return true">Booking without Fixed Instructor</a>


已解决;元素在 IFRAME 中;必须切换框架才能访问元素

尝试使用以下 WebElement,然后单击它:

//a[contains(text(),'Booking without Fixed Instructor')]
driver.find_element_by_class_name("sidelinkbold").click()

它有一个简单的 class 名称,您可以使用它来点击。

尝试使用:

webDriver.findElement(By.xpath("//a[@href='YOUR LINK']")).click();