mirror of
https://github.com/KenanZhu/AutoLibrary.git
synced 2026-06-18 15:33:03 +08:00
fix(pages): 移除裸 except Exception 改用精确异常类型并加固元素操作防护
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -44,8 +44,6 @@ class RecordsView:
|
||||
return self._driver.find_elements(*self.RECORDS_LIST)
|
||||
except TimeoutException:
|
||||
return None
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
def getRecordTimeElement(
|
||||
self,
|
||||
@@ -71,8 +69,6 @@ class RecordsView:
|
||||
)
|
||||
except TimeoutException:
|
||||
return False
|
||||
except Exception:
|
||||
return False
|
||||
try:
|
||||
more_btn = self._driver.find_element(*self.MORE_BTN)
|
||||
if more_btn.is_displayed() and more_btn.is_enabled():
|
||||
@@ -82,8 +78,6 @@ class RecordsView:
|
||||
return False
|
||||
except (NoSuchElementException, StaleElementReferenceException):
|
||||
return False
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def getRecordText(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user