diff --git a/.idea/Crawler.iml b/.idea/Crawler.iml index 4ba3f29..77ab65d 100644 --- a/.idea/Crawler.iml +++ b/.idea/Crawler.iml @@ -4,7 +4,7 @@ - + diff --git a/.idea/misc.xml b/.idea/misc.xml index a1ff0d1..f1bf6fa 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml index af70679..f245aa7 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,7 +1,6 @@ - diff --git a/Apps/XinDianTu/Config/__pycache__/Setting.cpython-312.pyc b/Apps/XinDianTu/Config/__pycache__/Setting.cpython-312.pyc new file mode 100644 index 0000000..ed33bac Binary files /dev/null and b/Apps/XinDianTu/Config/__pycache__/Setting.cpython-312.pyc differ diff --git a/Apps/XinDianTu/Images/SearchButton.jpg b/Apps/XinDianTu/Images/SearchButton.jpg new file mode 100644 index 0000000..391d4f9 Binary files /dev/null and b/Apps/XinDianTu/Images/SearchButton.jpg differ diff --git a/Apps/XinDianTu/Opener.py b/Apps/XinDianTu/Opener.py index 6b28c0f..1b68058 100644 --- a/Apps/XinDianTu/Opener.py +++ b/Apps/XinDianTu/Opener.py @@ -134,14 +134,19 @@ async def open_mini_program(): # 1. 点击搜索按钮(放大镜图标) # 仅保留坐标点击逻辑 - window_size = d.window_size() - w, h = window_size[0], window_size[1] + # window_size = d.window_size() + # w, h = window_size[0], window_size[1] + # + # # 精确相对坐标:x=84%, y=8% (基于截图推算) + # click_x = int(w * 0.84) + # click_y = int(h * 0.08) + # logger.info(f"使用精确坐标点击搜索按钮: ({click_x}, {click_y})") + # d.click(click_x, click_y) - # 精确相对坐标:x=84%, y=8% (基于截图推算) - click_x = int(w * 0.84) - click_y = int(h * 0.08) - logger.info(f"使用精确坐标点击搜索按钮: ({click_x}, {click_y})") - d.click(click_x, click_y) + # 点击搜索按钮(放大镜图标) + logger.info("尝试查找并点击 '搜索按钮(放大镜图标)'...") + d.image.click("SearchButton.jpg") + logger.info("点击了搜索按钮(放大镜图标)") # 点击后给予一定的加载时间 await asyncio.sleep(2) @@ -150,12 +155,12 @@ async def open_mini_program(): logger.info("准备输入搜索内容: 新电途") # 启用 u2 快速输入法 (使用更新的方法名) - d.set_input_ime(True) + # d.set_input_ime(True) # 尝试点击搜索框位置以确保获取焦点 (通常在顶部居中偏左) - 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) # 稍微多等一会儿让输入法准备好 + # 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) # 稍微多等一会儿让输入法准备好 # 直接发送按键 try: @@ -180,10 +185,16 @@ async def open_mini_program(): await asyncio.sleep(3) - # 兜底点击:点击搜索结果的第一项位置 (x=50%, y=18%) - res_x, res_y = int(w * 0.5), int(h * 0.18) - logger.info(f"尝试坐标点击第一项: ({res_x}, {res_y})") - d.click(res_x, res_y) + # # 兜底点击:点击搜索结果的第一项位置 (x=50%, y=18%) + # res_x, res_y = int(w * 0.5), int(h * 0.18) + # logger.info(f"尝试坐标点击第一项: ({res_x}, {res_y})") + # d.click(res_x, res_y) + + # 点击符合新电途图标的小程序 + logger.info("尝试查找并点击 '新电途小程序'...") + d.image.click("xdt.jpg") + logger.info("点击了新电途的小程序") + await asyncio.sleep(10) # 进入小程序后,检查并处理广告 await check_and_close_ad(d) diff --git a/Apps/XinDianTu/SearchButton.jpg b/Apps/XinDianTu/SearchButton.jpg new file mode 100644 index 0000000..391d4f9 Binary files /dev/null and b/Apps/XinDianTu/SearchButton.jpg differ diff --git a/Apps/XinDianTu/__pycache__/Crawler.cpython-312.pyc b/Apps/XinDianTu/__pycache__/Crawler.cpython-312.pyc new file mode 100644 index 0000000..24e2519 Binary files /dev/null and b/Apps/XinDianTu/__pycache__/Crawler.cpython-312.pyc differ diff --git a/Apps/XinDianTu/__pycache__/Kit.cpython-312.pyc b/Apps/XinDianTu/__pycache__/Kit.cpython-312.pyc new file mode 100644 index 0000000..7fdbefd Binary files /dev/null and b/Apps/XinDianTu/__pycache__/Kit.cpython-312.pyc differ diff --git a/Apps/XinDianTu/__pycache__/Opener.cpython-312.pyc b/Apps/XinDianTu/__pycache__/Opener.cpython-312.pyc new file mode 100644 index 0000000..e0c8df0 Binary files /dev/null and b/Apps/XinDianTu/__pycache__/Opener.cpython-312.pyc differ diff --git a/Apps/XinDianTu/__pycache__/ReadImageKit.cpython-312.pyc b/Apps/XinDianTu/__pycache__/ReadImageKit.cpython-312.pyc new file mode 100644 index 0000000..89498ac Binary files /dev/null and b/Apps/XinDianTu/__pycache__/ReadImageKit.cpython-312.pyc differ diff --git a/Apps/XinDianTu/__pycache__/Run.cpython-312.pyc b/Apps/XinDianTu/__pycache__/Run.cpython-312.pyc new file mode 100644 index 0000000..5d37f9d Binary files /dev/null and b/Apps/XinDianTu/__pycache__/Run.cpython-312.pyc differ diff --git a/Apps/XinDianTu/__pycache__/Service.cpython-312.pyc b/Apps/XinDianTu/__pycache__/Service.cpython-312.pyc new file mode 100644 index 0000000..b05ec16 Binary files /dev/null and b/Apps/XinDianTu/__pycache__/Service.cpython-312.pyc differ diff --git a/Config/__pycache__/Config.cpython-312.pyc b/Config/__pycache__/Config.cpython-312.pyc new file mode 100644 index 0000000..e3b6b7e Binary files /dev/null and b/Config/__pycache__/Config.cpython-312.pyc differ diff --git a/Core/__pycache__/BaseCrawler.cpython-312.pyc b/Core/__pycache__/BaseCrawler.cpython-312.pyc new file mode 100644 index 0000000..6c1944c Binary files /dev/null and b/Core/__pycache__/BaseCrawler.cpython-312.pyc differ diff --git a/DbKit/__pycache__/Db.cpython-312.pyc b/DbKit/__pycache__/Db.cpython-312.pyc new file mode 100644 index 0000000..52655cd Binary files /dev/null and b/DbKit/__pycache__/Db.cpython-312.pyc differ diff --git a/DbKit/__pycache__/SqlTemplateLoader.cpython-312.pyc b/DbKit/__pycache__/SqlTemplateLoader.cpython-312.pyc new file mode 100644 index 0000000..3cf3af8 Binary files /dev/null and b/DbKit/__pycache__/SqlTemplateLoader.cpython-312.pyc differ diff --git a/DbKit/__pycache__/TransactionContext.cpython-312.pyc b/DbKit/__pycache__/TransactionContext.cpython-312.pyc new file mode 100644 index 0000000..967fe52 Binary files /dev/null and b/DbKit/__pycache__/TransactionContext.cpython-312.pyc differ diff --git a/DbKit/__pycache__/__init__.cpython-312.pyc b/DbKit/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..f683abb Binary files /dev/null and b/DbKit/__pycache__/__init__.cpython-312.pyc differ diff --git a/Model/__pycache__/StationPriceSchedule.cpython-312.pyc b/Model/__pycache__/StationPriceSchedule.cpython-312.pyc new file mode 100644 index 0000000..f9dabdf Binary files /dev/null and b/Model/__pycache__/StationPriceSchedule.cpython-312.pyc differ diff --git a/Model/__pycache__/StationProfile.cpython-312.pyc b/Model/__pycache__/StationProfile.cpython-312.pyc new file mode 100644 index 0000000..061703d Binary files /dev/null and b/Model/__pycache__/StationProfile.cpython-312.pyc differ diff --git a/Model/__pycache__/StationStatus.cpython-312.pyc b/Model/__pycache__/StationStatus.cpython-312.pyc new file mode 100644 index 0000000..7adac84 Binary files /dev/null and b/Model/__pycache__/StationStatus.cpython-312.pyc differ diff --git a/Output/debug_ad_close_fail.jpg b/Output/debug_ad_close_fail.jpg index 466f62a..0a2654a 100644 Binary files a/Output/debug_ad_close_fail.jpg and b/Output/debug_ad_close_fail.jpg differ diff --git a/SearchButton.jpg b/SearchButton.jpg new file mode 100644 index 0000000..391d4f9 Binary files /dev/null and b/SearchButton.jpg differ diff --git a/Util/__pycache__/ObsUtil.cpython-312.pyc b/Util/__pycache__/ObsUtil.cpython-312.pyc new file mode 100644 index 0000000..3dd7aad Binary files /dev/null and b/Util/__pycache__/ObsUtil.cpython-312.pyc differ diff --git a/Util/__pycache__/OcrParser.cpython-312.pyc b/Util/__pycache__/OcrParser.cpython-312.pyc new file mode 100644 index 0000000..e60d39a Binary files /dev/null and b/Util/__pycache__/OcrParser.cpython-312.pyc differ diff --git a/Util/__pycache__/PaddleOCRKit.cpython-312.pyc b/Util/__pycache__/PaddleOCRKit.cpython-312.pyc new file mode 100644 index 0000000..df8c6a2 Binary files /dev/null and b/Util/__pycache__/PaddleOCRKit.cpython-312.pyc differ diff --git a/Util/__pycache__/RedisKit.cpython-312.pyc b/Util/__pycache__/RedisKit.cpython-312.pyc new file mode 100644 index 0000000..a15e8b2 Binary files /dev/null and b/Util/__pycache__/RedisKit.cpython-312.pyc differ diff --git a/Util/__pycache__/__init__.cpython-312.pyc b/Util/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..e36e401 Binary files /dev/null and b/Util/__pycache__/__init__.cpython-312.pyc differ diff --git a/xdt.jpg b/xdt.jpg new file mode 100644 index 0000000..cb7ea30 Binary files /dev/null and b/xdt.jpg differ diff --git a/xdt1.jpg b/xdt1.jpg new file mode 100644 index 0000000..65febb3 Binary files /dev/null and b/xdt1.jpg differ