From 757658c48ce9e15140c6af7d6b8014df621ad141 Mon Sep 17 00:00:00 2001 From: Bauke Date: Wed, 14 Aug 2019 12:41:06 +0200 Subject: [PATCH] fix: add a timeout to scraping --- main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.go b/main.go index 61391db..5e84837 100644 --- a/main.go +++ b/main.go @@ -5,6 +5,7 @@ import ( "os" "sort" "strings" + "time" "github.com/gocolly/colly" log "github.com/sirupsen/logrus" @@ -28,6 +29,7 @@ func main() { // When receiving HTML: collector.OnHTML("html", func(page *colly.HTMLElement) { + time.Sleep(time.Second) // Define the URL for brevity url := page.Request.URL.String() if strings.HasSuffix(url, "/groups") {