Skip to content

Commit

Permalink
use better site as example
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmood committed Aug 27, 2022
1 parent 635c06d commit e82236f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,20 +292,20 @@ func Example_wait_for_request() {
browser := rod.New().MustConnect()
defer browser.MustClose()

page := browser.MustPage("https://duckduckgo.com/")
page := browser.MustPage("https://www.wikipedia.org/").MustWaitLoad()

// Start to analyze request events
wait := page.MustWaitRequestIdle()

// This will trigger the search ajax request
page.MustElement("#searchbox_input").MustClick().MustInput("lisp")
page.MustElement("#searchInput").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("[class*=searchbox_suggestion]")) > 0)
fmt.Println(len(page.MustElements(".suggestion-link")) > 0)

// Output: true
}
Expand Down

0 comments on commit e82236f

Please sign in to comment.