【发布时间】:2016-03-15 12:29:40
【问题描述】:
我有以下代码:
def test_counter(self):
try:
if self.driver.find_element_by_id(self.counter).text == 'texttexttext':
return True
except NoSuchElementException and StaleElementReferenceException:
self.fix_error()
return False
我不知道为什么NoSuchElementException 或StaleElementReferenceException 没有被抓到。
【问题讨论】: