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