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

ubuntu Jammy 能正常运行MustScreenshot #1165

Closed
lsy88 opened this issue Dec 23, 2024 · 1 comment
Closed

ubuntu Jammy 能正常运行MustScreenshot #1165

lsy88 opened this issue Dec 23, 2024 · 1 comment
Labels
question Questions related to rod

Comments

@lsy88
Copy link

lsy88 commented Dec 23, 2024

Rod Version: v0.114.8

The code to demonstrate your question

l := launcher.New().
 	Set("disable-blink-features", "AutomationControlled").
 	Set("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36").
 	Set("disable-default-apps").
 	Set("no-sandbox", "true").
 	Set("no-default-browser-check").
 	Set("enable-privacy-sandbox-ads-apis", "false").
 	Set("disable-web-security").
 	Set("headless", "new").
 	Set("no-first-run").
 	Leakless(false)
 path, has := launcher.LookPath()
 if has {
 	l = l.Bin(path)
 }
imgBytes := page.Timeout(20 * time.Second).MustElement(`#captcha_img`).MustScreenshot()

What you got

error value: &runtime.TypeAssertionError{_interface:(*abi.Type)(0x1046a00), concrete:(*abi.Type)(0x112e0a0), asserted:(*abi.Type)(0x112dfa0), missingMethod:""}
goroutine 112 [running]:
runtime/debug.Stack()
        C:/Users/li.sy/go1.21.6/src/runtime/debug/stack.go:24 +0x5e
github.com/go-rod/rod.Try.func1()
        C:/Users/li.sy/go/pkg/mod/github.com/go-rod/rod@v0.114.8/utils.go:213 +0x3d
panic({0x100b5e0?, 0xc0003bc030?})
        C:/Users/li.sy/go1.21.6/src/runtime/panic.go:914 +0x21f
github.com/go-rod/rod/lib/utils.CropImage({0xc000920000, 0x10520, 0x10521}, 0x0, 0x186, 0x1b1, 0xc8, 0x3c)
        C:/Users/li.sy/go/pkg/mod/github.com/go-rod/rod@v0.114.8/lib/utils/utils.go:348 +0x31f
github.com/go-rod/rod.(*Element).Screenshot(0xc0002e2c90, {0x11b2a15, 0x3}, 0x0)
        C:/Users/li.sy/go/pkg/mod/github.com/go-rod/rod@v0.114.8/element.go:700 +0x154
github.com/go-rod/rod.(*Element).MustScreenshot(0xc0002e2c90, {0x0, 0x0, 0x0})
        C:/Users/li.sy/go/pkg/mod/github.com/go-rod/rod@v0.114.8/must.go:996 +0x45

What you expect to see

当我在Ubuntu 18.04.6 LTS上面可以正常执行,但是在22.04.4 LTS (Jammy Jellyfish)就会出现上面的报错,我希望能在22.04.4 LTS (Jammy Jellyfish)也正常运行

@lsy88 lsy88 added the question Questions related to rod label Dec 23, 2024
Copy link

Please fix the format of your markdown:

27 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## What you got"]
28 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```"]
28 MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]

generated by check-issue

@lsy88 lsy88 closed this as completed Dec 23, 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

1 participant