Skip to content

Commit

Permalink
Don't rescrape the same page
Browse files Browse the repository at this point in the history
  • Loading branch information
pppontusw committed May 9, 2024
1 parent 402a8fc commit c3955a1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/scraper/scrapers.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ func (bs *BaseScraper) Scrape(maxWorkers int) ([]models.Product, error) {
break // Exit loop if there's no next URL
}

if nextURL == currentURL {
break // Exit loop if the next URL is the same as the current URL
}

currentURL = nextURL
}
}(url)
Expand Down

0 comments on commit c3955a1

Please sign in to comment.