go-rod / rod

A Chrome DevTools Protocol driver for web automation and scraping.
https://go-rod.github.io
MIT License
5.42k stars 356 forks source link

randomly panic #1133

Open Q191 opened 3 weeks ago

Q191 commented 3 weeks ago

Rod Version: v0.116.2

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:

const EDGE_BINARY_PATH = "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"

func main() {
    l := launcher.New().Bin(EDGE_BINARY_PATH).Headless(true)
    lUrl := l.MustLaunch()
    browser := rod.New().ControlURL(lUrl).Trace(true).MustConnect()
    page := browser.MustPage("https://github.com/go-rod/rod")
    defer func() {
        page.Close()
        page.Browser().Close()
        l.Cleanup()
    }()
        page.MustElement("xx") 
    time.Sleep(10 * time.Second)
}

What you got

randomly panic

image

image

What you expect to see

no panic

What have you tried to solve the question

github-actions[bot] commented 3 weeks ago

Please fix the format of your markdown:

36 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## What you got"]

generated by check-issue

ysmood commented 3 weeks ago

Can you be more specific?