测试 x2
设置最长截图等待时间,避免报错,至少把图截出来。
This commit is contained in:
@@ -24,7 +24,9 @@ class ScreenShot(PlayContextManager):
|
|||||||
|
|
||||||
async def shot(self, save_path: str) -> None:
|
async def shot(self, save_path: str) -> None:
|
||||||
await self.page.mouse.move(0, 0)
|
await self.page.mouse.move(0, 0)
|
||||||
await self.page.wait_for_load_state("networkidle")
|
try:
|
||||||
|
await self.page.wait_for_load_state("networkidle", timeout=1000)
|
||||||
|
finally:
|
||||||
await self.page.screenshot(path=save_path)
|
await self.page.screenshot(path=save_path)
|
||||||
logger.debug(f"截图 | 截图已经保存在 {save_path=}")
|
logger.debug(f"截图 | 截图已经保存在 {save_path=}")
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user