diff options
| author | horus | 2018-06-15 23:28:18 +0200 |
|---|---|---|
| committer | horus | 2018-06-15 23:28:18 +0200 |
| commit | 8d68ac7c900241eb8499a94c23ab1f60750e7aed (patch) | |
| tree | 3a5d444f866383d5cdefc512242dc2afa236641e /crawler/shop_whiskysitenl.go | |
| parent | 0026ba55f03c5378d5773459fcdd7c6931ff42a5 (diff) | |
| download | alkobote-8d68ac7c900241eb8499a94c23ab1f60750e7aed.tar.gz | |
Introduces config for user agent, robots.txt and crawler delay. (crawler)
Diffstat (limited to 'crawler/shop_whiskysitenl.go')
| -rw-r--r-- | crawler/shop_whiskysitenl.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crawler/shop_whiskysitenl.go b/crawler/shop_whiskysitenl.go index 4dad313..e3ae075 100644 --- a/crawler/shop_whiskysitenl.go +++ b/crawler/shop_whiskysitenl.go @@ -13,7 +13,7 @@ func (app *App) ScrapeWhiskysitenl(shop Shop) []Angebot { Shop_url := "https://www.whiskysite.nl/en/specials/?limit=100" - c := customCollector([]string{"whiskysite.nl", "www.whiskysite.nl"}) + c := app.customCollector([]string{"whiskysite.nl", "www.whiskysite.nl"}) c.OnHTML(".product-block", func(e *colly.HTMLElement) { @@ -138,7 +138,10 @@ func (app *App) ScrapeWhiskysitenl(shop Shop) []Angebot { e.Request.Ctx.Put("website", string(e.Response.Body)) }) - c.Visit(Shop_url) + err := c.Visit(Shop_url) + if err != nil { + Warn(nil, shop.Name+": "+err.Error()) + } return Whiskys } |
