更新 playwright_automation 和 screenshots 服务

This commit is contained in:
2025-12-14 22:04:05 +08:00
parent a346509a5f
commit dac06d187e
2 changed files with 39 additions and 29 deletions

View File

@@ -1375,24 +1375,13 @@ class PlaywrightAutomation:
# 先保存到临时文件
temp_filepath = filepath + '.tmp'
# 获取iframe并截取其完整内容
iframe = self.get_iframe_safe()
if iframe:
# 对iframe内容进行全页截图
iframe.screenshot(
path=temp_filepath,
type='jpeg',
full_page=True,
quality=100
)
else:
# 回退到主页面截图
self.main_page.screenshot(
path=temp_filepath,
type='jpeg',
full_page=True,
quality=100
)
# 截图:默认截取主页面(包含左侧菜单/顶部栏等整体界面)
self.main_page.screenshot(
path=temp_filepath,
type='jpeg',
full_page=True,
quality=100
)
# 验证文件是否成功创建且大小合理
if not os.path.exists(temp_filepath):