From 8d68ac7c900241eb8499a94c23ab1f60750e7aed Mon Sep 17 00:00:00 2001 From: horus Date: Fri, 15 Jun 2018 23:28:18 +0200 Subject: Introduces config for user agent, robots.txt and crawler delay. (crawler) --- crawler/shop_whiskyzone.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'crawler/shop_whiskyzone.go') diff --git a/crawler/shop_whiskyzone.go b/crawler/shop_whiskyzone.go index 4dc825a..dbaf0ba 100644 --- a/crawler/shop_whiskyzone.go +++ b/crawler/shop_whiskyzone.go @@ -13,7 +13,7 @@ func (app *App) ScrapeWhiskyzone(shop Shop) []Angebot { Whiskys := []Angebot{} - c := customCollector([]string{"whiskyzone.de", "www.whiskyzone.de"}) + c := app.customCollector([]string{"whiskyzone.de", "www.whiskyzone.de"}) c.OnHTML(".product--info", func(e *colly.HTMLElement) { @@ -154,7 +154,10 @@ func (app *App) ScrapeWhiskyzone(shop Shop) []Angebot { }) - c.Visit(Shop_url) + err := c.Visit(Shop_url) + if err != nil { + Warn(nil, shop.Name+": "+err.Error()) + } return Whiskys } -- cgit v1.2.3