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_whiskyde.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'crawler/shop_whiskyde.go') diff --git a/crawler/shop_whiskyde.go b/crawler/shop_whiskyde.go index 9e061ac..d3087ca 100644 --- a/crawler/shop_whiskyde.go +++ b/crawler/shop_whiskyde.go @@ -11,7 +11,7 @@ func (app *App) ScrapeWhiskyde(shop Shop) []Angebot { Whiskys := []Angebot{} - c := customCollector([]string{"whisky.de", "www.whisky.de"}) + c := app.customCollector([]string{"whisky.de", "www.whisky.de"}) c.OnHTML(".is-buyable", func(e *colly.HTMLElement) { @@ -118,7 +118,10 @@ func (app *App) ScrapeWhiskyde(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 } -- cgit v1.2.3