from selenium import webdriverfrom selenium.webdriver.common.by import Byfrom selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.chrome.optionsdiv[5]
我正在尝试让selenium找到一个元素并单击它。该元素如下:
<button class="btn btn-link">search criteria: on support work 'took place on' (grouped by author我们的目标是让Selenium填写表单,然后单击“更新”。我尝试了几种不同的方法('find_ element _by_xpath','...by_class_name',
我正在使用selenium来运行我创建的测试。现在我想开始错误处理。我希望能够获得找不到的元素,并在我的错误日志中显示类似于"Element start could not be found"的内容。目前,我只是将每个测试包装在一个try catch中,然后说Couldn't find element,然而,这是非常广泛的,并且不会缩小它找不到的元素的范围。