Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

每次调用截图功能,不管结束没结束,按ctrl+c结束任务后,会弹出一个黑色的控制台,这是什么? #1098

Closed
arieslee opened this issue Jul 22, 2024 · 2 comments
Labels
question Questions related to rod

Comments

@arieslee
Copy link

Rod Version: v0.116.2

关键代码:

	launcher := s.launcher(req)
	page := rod.New().ControlURL(launcher.MustLaunch()).MustConnect().MustPage(req.Url)
	defer func() {
		page.MustClose()
		launcher.Cleanup()
	}()
	ua := &proto.NetworkSetUserAgentOverride{
		UserAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
	}
	page.MustSetViewport(682, 1080, 1, true).SetUserAgent(ua)
	page.MustSearch(`#verify-bar-close`).MustClick()
	page.MustSearch(`[class="css-id3gl-IconClose e1vz198y3"]`).MustClick()
	saveName := saveFileName(req.FileName, req.Url)
	pageWaitStable := page.MustWaitStable()
	pageWaitStable.MustScreenshot(saveName)

如果多次截图,会出现多个黑色的控制台,按ctrl+c后,弹出,请问这是什么?我能不能在截图完成后,用程序关闭它?

@arieslee arieslee added the question Questions related to rod label Jul 22, 2024
Copy link

Please fix the format of your markdown:

4 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```go"]
20 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```"]

generated by check-issue

@ysmood
Copy link
Member

ysmood commented Jul 22, 2024

leakless

@ysmood ysmood closed this as completed Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Questions related to rod
Projects
None yet
Development

No branches or pull requests

2 participants