1
1
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:
2026-05-28 01:36:18 +08:00
parent 910e3e3224
commit df7ad92f7f
13 changed files with 156 additions and 195 deletions
-6
View File
@@ -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,