main
HuangHai 5 months ago
parent 094795af4c
commit 0e196f0130

@ -292,14 +292,17 @@ def paiCheng(page, keyword):
# 点击 <input> 元素 # 点击 <input> 元素
time_input.click() time_input.click()
# 定位目标 <input> 元素 time.sleep(0.5)
hour_input = page.locator("input.owl-dt-timer-input").nth(3) # 第一个输入框(小时) hour_input = page.locator("input.owl-dt-timer-input").nth(0) # 第一个输入框(小时)
minute_input = page.locator("input.owl-dt-timer-input").nth(4) # 第二个输入框(分钟) minute_input = page.locator("input.owl-dt-timer-input").nth(1) # 第二个输入框(分钟)
second_input = page.locator("input.owl-dt-timer-input").nth(5) # 第三个输入框(秒) second_input = page.locator("input.owl-dt-timer-input").nth(2) # 第三个输入框(秒)
# 输入时间 # 输入时间
hour_input.fill("13") # 输入小时 hour_input.fill("13") # 输入小时
minute_input.fill("01") # 输入分钟 minute_input.fill("01") # 输入分钟
second_input.fill("00") # 输入秒 second_input.fill("00") # 输入秒
# 定位 <button> 元素
set_button = page.locator("button.owl-dt-control-button", has_text="Set")
set_button.click()
def run(playwright: Playwright) -> None: def run(playwright: Playwright) -> None:
# 启动浏览器,禁用无头模式 # 启动浏览器,禁用无头模式

Loading…
Cancel
Save