summaryrefslogtreecommitdiff
path: root/crawler/shop_whiskyde.go
diff options
context:
space:
mode:
Diffstat (limited to 'crawler/shop_whiskyde.go')
-rw-r--r--crawler/shop_whiskyde.go8
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
}