-
-
Notifications
You must be signed in to change notification settings - Fork 438
Open
Description
Use MustWaitRequestIdle based on the sample code, but once MustWaitStable is added, The output is not as expected.
rod version is v0.116.2
func main() {
browser := rod.New().MustConnect()
defer browser.MustClose()
page := browser.MustPage("https://duckduckgo.com/")
//page.MustWaitStable() // If this line is used, the MustWaitRequestIdle function will not work.
// Start to analyze request events
wait := page.MustWaitRequestIdle()
// This will trigger the search ajax request
page.MustElement("#searchbox_input").MustClick().MustInput("lisp")
// Wait until there's no active requests
wait()
// We want to make sure that after waiting, there are some autocomplete
// suggestions available.
fmt.Println(len(page.MustElements(".searchbox_suggestions__5vqa7")) > 0)
time.Sleep(20 * time.Second)
}
Metadata
Metadata
Assignees
Labels
No labels