This commit is contained in:
sjk
2026-01-17 13:11:40 +08:00
parent 3d402639da
commit a6326a8ccb
2 changed files with 31 additions and 4 deletions

View File

@@ -85,12 +85,16 @@ class MIPAdAutomation:
if not has_ad:
logger.info("未检测到商业广告,跳过该链接")
# 记录无广告
self._record_click_failure(url, "未检测到商业广告")
return False, False
# 点击广告
logger.info("检测到商业广告,准备点击")
if not self._click_advertisement(ad_element):
logger.warning("点击广告失败")
# 记录点击失败
self._record_click_failure(url, "广告点击失败,页面未跳转")
return False, False
# 记录点击到数据库
@@ -110,6 +114,11 @@ class MIPAdAutomation:
except Exception as e:
logger.error(f"处理链接异常: {str(e)}")
# 记录异常
try:
self._record_click_failure(url, f"异常: {str(e)}")
except:
pass
return False, False
finally:
# 尝试关闭当前标签页,返回主窗口