This commit is contained in:
27942
2026-02-27 14:33:35 +08:00
parent f600b1720e
commit 329932ef94

View File

@@ -55,7 +55,7 @@ def _piece_bbox(alpha: np.ndarray, threshold: int = 12) -> tuple[int, int, int,
def calc_drag_distance_from_bytes( 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: ) -> dict:
"""计算拼图目标位移(基于背景图 + 拼图块图)。""" """计算拼图目标位移(基于背景图 + 拼图块图)。"""
bg = _to_rgb_array(bg_bytes) bg = _to_rgb_array(bg_bytes)
@@ -278,12 +278,12 @@ def drag_slider(page, slider_ele, distance: int) -> None:
# ---------- 核心自动化流程 ---------- # ---------- 核心自动化流程 ----------
def submit_phone( def submit_phone(
page, page,
phone: str, phone: str,
url: str = "http://yscnb.com/tyyp/", url: str = "http://yscnb.com/tyyp/",
alpha_threshold: int = 12, alpha_threshold: int = 12,
distance_adjust: int = 0, distance_adjust: int = 0,
wait_page: float = 0.3, wait_page: float = 0.3,
) -> Any: ) -> Any:
""" """
填写手机号、点击获取验证码、执行滑块,返回 getYanZhenMa/v2 接口响应体。 填写手机号、点击获取验证码、执行滑块,返回 getYanZhenMa/v2 接口响应体。
@@ -521,6 +521,13 @@ def main() -> None:
print("hn_userEquitys/getYanZhenMa/v2 响应:") print("hn_userEquitys/getYanZhenMa/v2 响应:")
print(body) 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__": if __name__ == "__main__":
main() main()