Skip to content

Commit

Permalink
Merge pull request #31 from DanielFillol/daniel
Browse files Browse the repository at this point in the history
feat: WaitPageLoad was with wrong timeout
  • Loading branch information
DanielFillol authored Jul 11, 2024
2 parents 67320a3 + f171e2b commit 6ec7cd2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions goSpider.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ func (nav *Navigator) WaitPageLoad() (string, error) {
start := time.Now()
var pageHTML string
for {
if time.Since(start) > nav.Timeout {
if time.Since(start) > time.Minute {
nav.Logger.Println("Error - Timeout waiting for page to fully load")
return "", fmt.Errorf("error - timeout waiting for page to fully load")
}
Expand All @@ -551,7 +551,7 @@ func (nav *Navigator) WaitPageLoad() (string, error) {
break
}
nav.Logger.Println("INFO: Page is not fully loaded yet, retrying...")
time.Sleep(300 * time.Millisecond)
time.Sleep(nav.Timeout)
}

nav.Logger.Println("INFO: Page is fully loaded")
Expand Down

0 comments on commit 6ec7cd2

Please sign in to comment.