hahza
This commit is contained in:
21
test1.py
21
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()
|
||||
|
||||
Reference in New Issue
Block a user