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

Code does not continue running when use chromium: Chromium 128.0.6613.84 Alpine Linux #1107

Closed
lekhang2512 opened this issue Aug 28, 2024 · 1 comment
Labels
question Questions related to rod

Comments

@lekhang2512
Copy link

lekhang2512 commented Aug 28, 2024

Rod Version: v0.116.1

The code to demonstrate your question

  1. Clone Rod to your local and cd to the repository:

    git clone https://github.com/go-rod/rod
    cd rod
  2. Use your code to replace the content of function TestRod in file rod_test.go.

  3. Test your code with: go test -run TestRod, make sure it fails as expected.

  4. Replace ALL THE CONTENT under "The code to demonstrate your question" with your TestRod function, like below:

func TestRod(t *testing.T) {
        fmt.Println("Starting process...")

	startTime := time.Now()

	path, _ := launcher.LookPath()
	u := launcher.New().Bin(path).MustLaunch()
	browser := rod.New().ControlURL(u).MustConnect()

	// Even you forget to close, rod will close it after main process ends.
	defer browser.MustClose()

	// Create a new page
	fmt.Println("link: ", "https://www.google.com/maps/search/Vincom+Center+B%C3%A0+Tri%E1%BB%87u?authuser=0&entry=ttu&hl=en")
	page := browser.MustPage("https://www.google.com/maps/search/Vincom+Center+B%C3%A0+Tri%E1%BB%87u?authuser=0&entry=ttu&hl=en").MustWaitStable()
	fmt.Println("page: ", page)

	endTime := time.Now()

	fmt.Println("Process completed.")
	fmt.Printf("Start time: %s\n", startTime.Format(time.RFC3339))
	fmt.Printf("End time: %s\n", endTime.Format(time.RFC3339))
	fmt.Printf("Duration: %s\n", endTime.Sub(startTime))
}

What you got

Code does not continue running after calling browser.MustPage
panic: test timed out after 5m0s

What you expect to see

I need the program to keep running for processing page
html, err := page.HTML()

What have you tried to solve the question

I use: apk add chromium
I tried downgrading to a lower version of chromium but it didn't work
Before chromium version: Chromium 125.0.6422.112 Alpine Linux

@lekhang2512 lekhang2512 added the question Questions related to rod label Aug 28, 2024
@github-staff github-staff deleted a comment Aug 28, 2024
@lekhang2512
Copy link
Author

I downgrade version go from
FROM golang:1.22-alpine3.19
Chromium 124.0.6367.78 Alpine Linux
is working

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