update: failed attempts markup

This commit is contained in:
2025-07-25 19:25:12 +08:00
parent f87762f5bd
commit deb366880e

View File

@@ -329,15 +329,16 @@ def main():
try: try:
wait = WebDriverWait(driver, timeout=args.interval) wait = WebDriverWait(driver, timeout=args.interval)
alert = wait.until(lambda x: x.find_element(By.CSS_SELECTOR, "div.io-ox-alert.io-ox-alert-error")) alert = wait.until(lambda x: x.find_element(By.CSS_SELECTOR, "div.io-ox-alert.io-ox-alert-error"))
sents[current] = ''
message = alert.text.replace('\n', ' ') message = alert.text.replace('\n', ' ')
if not message: print(f'[警告] 程序异常。请保持页面在前台显示,避免遮挡或最小化') if not message: raise Exception('程序异常。请保持页面在前台显示,避免遮挡或最小化')
else: print(f'[警告] ({attempt}): {message}') print(f'[警告] ({attempt}): {message}')
# 关闭警告 # 关闭警告
click("div.io-ox-alert.io-ox-alert-error button[data-action='close']") click("div.io-ox-alert.io-ox-alert-error button[data-action='close']")
except TimeoutException: except TimeoutException:
sents[current] = '' sents[current] = ''
occurrence[0] += 1 occurrence[0] += 1
sent += 1 sent += 1
break break