'commit'
This commit is contained in:
@@ -221,11 +221,18 @@ class TeLaiDianCrawler(BaseCrawler):
|
||||
pass
|
||||
|
||||
template_xczs = os.path.join(os.path.dirname(__file__), "Template", "xczs.jpg")
|
||||
logger.info("[详情页] 检查是否存在温馨提示弹窗(下次再说)...")
|
||||
try:
|
||||
await asyncio.sleep(0.5)
|
||||
if os.path.exists(template_xczs):
|
||||
if d.image.click(template_xczs, timeout=3.0):
|
||||
clicked = d.image.click(template_xczs, timeout=3.0)
|
||||
if clicked:
|
||||
logger.info("[详情页] 检测到温馨提示弹窗,已点击“下次再说”关闭。")
|
||||
await asyncio.sleep(1.5)
|
||||
else:
|
||||
logger.info("[详情页] 未在当前页面匹配到温馨提示弹窗模板。")
|
||||
else:
|
||||
logger.info(f"[详情页] 温馨提示模板文件不存在: {template_xczs}")
|
||||
except Exception as e:
|
||||
logger.error(f"[详情页] 通过模板点击关闭温馨提示弹窗失败: {e}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user