|
@@ -78,10 +78,12 @@ func (self *ToolController) GetHaibaoWithGoogle() {
|
|
|
// 运行任务(导航到网页,并捕获屏幕截图)
|
|
// 运行任务(导航到网页,并捕获屏幕截图)
|
|
|
var buf []byte
|
|
var buf []byte
|
|
|
err = chromedp.Run(ctx,
|
|
err = chromedp.Run(ctx,
|
|
|
|
|
+ chromedp.WaitVisible("body", chromedp.ByQuery),
|
|
|
chromedp.EmulateViewport(1400, 800), // 设置视口宽度为 1400,高度为 800
|
|
chromedp.EmulateViewport(1400, 800), // 设置视口宽度为 1400,高度为 800
|
|
|
chromedp.Navigate(decodedUri), // 替换为你想截图的网页地址
|
|
chromedp.Navigate(decodedUri), // 替换为你想截图的网页地址
|
|
|
chromedp.FullScreenshot(&buf, 90), // 调整质量参数
|
|
chromedp.FullScreenshot(&buf, 90), // 调整质量参数
|
|
|
)
|
|
)
|
|
|
|
|
+
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
fmt.Println("error occured!")
|
|
fmt.Println("error occured!")
|
|
|
log.Fatal(err)
|
|
log.Fatal(err)
|