Loading... 现在里面缺一个图片识别的,这个可以对接cv2或者yolo去做,这就相当于是图色了 ```python #!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2025/3/4 00:02 # @Author : huoyu # @email : 2319899766@qq.com # @File : pinduoduo2.py # @Project : jingdong_shaixuan # @Software: PyCharm from time import sleep from hyuiauto import AndroidConnector # Initialize the connector ac = AndroidConnector() # Connect to the device using its serial number device = ac.device(sn="99191FFBA0069C") # Check if connection was successful if device is not None: print("Connected to:", device) # Open WeChat (com.tencent.mm), not Alipay as your comment suggests device.openApp('com.tencent.mm') else: print("Failed to connect to device with serial 99191FFBA0069C") print(device.tapTextOnScreen('微信', exact=False)) # 获取屏幕大小 width, height = device.wm_size() print(f"屏幕宽度: {width}, 屏幕高度: {height}") # 计算滑动起点和终点 start_x = width // 2 # 屏幕中央 start_y = height // 4 # 1/4 处开始 end_y = height * 3 // 4 # 3/4 处结束 # 执行下拉滑动 device.swipe(start_x, start_y, start_x, end_y, duration=10) sleep(2) pdd_tp=device.tapTextOnScreen('拼多多', exact=False) device.tap(pdd_tp[0],pdd_tp[1]) sleep(3) # 打印搜索结果 txt = device.screenToText() print(txt) scrPng=device.screenCap() with open('tmp.png','wb') as f: f.write(scrPng) ``` 最后修改:2025 年 03 月 05 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 如果觉得我的文章对你有用,请随意赞赏