This commit is contained in:
HuangHai
2026-01-17 07:21:21 +08:00
parent a3a77b8333
commit f6fb2ab97f
8 changed files with 97 additions and 18 deletions

View File

@@ -84,8 +84,19 @@ async def open_mini_program():
await asyncio.sleep(2)
# 4. 输入搜索内容
logger.info("输入搜索内容: 艾特吉易充")
try:
d.set_input_ime(True)
except Exception as e:
logger.warning(f"启用 FastInputIME 失败: {e}")
try:
search_bar_x, search_bar_y = int(w * 0.4), int(h * 0.08)
d.click(search_bar_x, search_bar_y)
await asyncio.sleep(1.5)
except Exception as e:
logger.warning(f"点击搜索框以获取焦点失败: {e}")
try:
logger.info("尝试输入文字: 艾特吉易充")
d.send_keys("艾特吉易充")
@@ -101,6 +112,11 @@ async def open_mini_program():
await asyncio.sleep(3)
try:
d.set_input_ime(False)
except Exception as e:
logger.warning(f"恢复系统输入法失败: {e}")
# 5. 点击小程序
logger.info("点击搜索结果中的小程序...")
# 这里由于没有模板,先使用坐标点击作为第一版的测试逻辑 (通常第一个结果在 50%, 18%)