feat: 添加页面加载延时
This commit is contained in:
parent
056767b4f0
commit
eed624194a
@ -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{
|
||||
|
Loading…
x
Reference in New Issue
Block a user