diff options
| author | Max | 2018-02-10 01:57:53 +0100 |
|---|---|---|
| committer | Max | 2018-02-10 01:57:53 +0100 |
| commit | 374defdff5502123d84e2e48fdd4faa4636447da (patch) | |
| tree | 28b2702e7560ce554aeaa903365d2df7c8ac60ae | |
| parent | 88a87ea01009fb16dc780d582d10e1f0aeb92357 (diff) | |
| download | alkobote-374defdff5502123d84e2e48fdd4faa4636447da.tar.gz | |
Minor improvements. (whiskyde)
| -rw-r--r-- | crawler/shop_whiskyde.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crawler/shop_whiskyde.go b/crawler/shop_whiskyde.go index d90e0cc..f3c5f3f 100644 --- a/crawler/shop_whiskyde.go +++ b/crawler/shop_whiskyde.go @@ -8,6 +8,8 @@ import ( ) func ScrapeWhiskyde(shop Shop) []Angebot { + Shop_url := "https://www.whisky.de/shop/Aktuell/Sonderangebote/" + Whiskys := []Angebot{} c := colly.NewCollector( @@ -17,6 +19,10 @@ func ScrapeWhiskyde(shop Shop) []Angebot { c.OnHTML(".is-buyable", func(e *colly.HTMLElement) { + if e.Request.URL.String() != Shop_url { + return + } + W := Angebot{} whisky_name := e.ChildAttr("a", "title") W.Name = whisky_name @@ -52,7 +58,7 @@ func ScrapeWhiskyde(shop Shop) []Angebot { Whiskys = append(Whiskys, W) }) - c.Visit("https://www.whisky.de/shop/Aktuell/Sonderangebote/") + c.Visit(Shop_url) return Whiskys } |
