From 98e9302f7e6f1d78eac690c35fc26b2184a20a53 Mon Sep 17 00:00:00 2001 From: HuangHai <10402852@qq.com> Date: Mon, 3 Mar 2025 15:24:46 +0800 Subject: [PATCH] 'commit' --- AI/Ylt/Upload.py | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/AI/Ylt/Upload.py b/AI/Ylt/Upload.py index 8faa5801..ccdebba4 100644 --- a/AI/Ylt/Upload.py +++ b/AI/Ylt/Upload.py @@ -286,17 +286,17 @@ def paiCheng(page, keyword, stHour, stMin, stSec, endHour, endMin, endSec): span_handle = spans.nth(index).element_handle() span_handle.evaluate("element => element.click()") break - # 等待 - # 定位目标 元素 + + # 等待动态页面加载完成 + wait(2) + # 输入开始时间 input_element = page.locator("input#mat-input-3") # 通过 id 定位 - input_element.wait_for(state="visible", timeout=5000) # 等待元素可见,最多 5 秒 input_element.click() # 定位目标 元素 hour_input = page.locator("input.owl-dt-timer-input").nth(0) # 第一个输入框(小时) minute_input = page.locator("input.owl-dt-timer-input").nth(1) # 第二个输入框(分钟) second_input = page.locator("input.owl-dt-timer-input").nth(2) # 第三个输入框(秒) - wait() # 输入时间 hour_input.fill(stHour) # 输入小时 wait() @@ -304,24 +304,19 @@ def paiCheng(page, keyword, stHour, stMin, stSec, endHour, endMin, endSec): wait() second_input.fill(stSec) # 输入秒 wait() - - # 定位