feat: 添加页面加载延时

This commit is contained in:
lixiangwuxian 2024-10-13 05:02:47 +08:00
parent 056767b4f0
commit eed624194a

View File

@ -50,6 +50,7 @@ func ScreenshotURL(url, output string, width, height int, marginTop, marginRight
err := chromedp.Run(ctx,
chromedp.Navigate(url), // 打开网页
ignoreErrors(queryAction), // 等待指定元素
chromedp.Sleep(5*time.Second),
chromedp.ActionFunc(func(ctx context.Context) error { // 自定义截图逻辑
// 计算调整后的截图区域
clip := &page.Viewport{