From 329932ef9475687a4cd3bc30bf5639b45033f7ba Mon Sep 17 00:00:00 2001 From: 27942 Date: Fri, 27 Feb 2026 14:33:35 +0800 Subject: [PATCH] hahza --- test1.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/test1.py b/test1.py index 008c80b..265eca3 100644 --- a/test1.py +++ b/test1.py @@ -55,7 +55,7 @@ def _piece_bbox(alpha: np.ndarray, threshold: int = 12) -> tuple[int, int, int, def calc_drag_distance_from_bytes( - bg_bytes: bytes, piece_bytes: bytes, alpha_threshold: int = 12 + bg_bytes: bytes, piece_bytes: bytes, alpha_threshold: int = 12 ) -> dict: """计算拼图目标位移(基于背景图 + 拼图块图)。""" bg = _to_rgb_array(bg_bytes) @@ -278,12 +278,12 @@ def drag_slider(page, slider_ele, distance: int) -> None: # ---------- 核心自动化流程 ---------- def submit_phone( - page, - phone: str, - url: str = "http://yscnb.com/tyyp/", - alpha_threshold: int = 12, - distance_adjust: int = 0, - wait_page: float = 0.3, + page, + phone: str, + url: str = "http://yscnb.com/tyyp/", + alpha_threshold: int = 12, + distance_adjust: int = 0, + wait_page: float = 0.3, ) -> Any: """ 填写手机号、点击获取验证码、执行滑块,返回 getYanZhenMa/v2 接口响应体。 @@ -521,6 +521,13 @@ def main() -> None: print("hn_userEquitys/getYanZhenMa/v2 响应:") print(body) + input_code(page=page, code=123123) + + +def input_code(page, code): + page.ele('x://input[@placeholder="请输入验证码"]').input(code) + page.ele('x://*[@id="app"]/div/img').click(by_js=True) + page.ele('x://*[@id="app"]/div/div[7]/div/div[3]/button[2]').click(by_js=True) if __name__ == "__main__": main()