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.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/crawler/shop_whiskyde.go b/crawler/shop_whiskyde.go
index f3c5f3f..de55600 100644
--- a/crawler/shop_whiskyde.go
+++ b/crawler/shop_whiskyde.go
@@ -52,9 +52,36 @@ func ScrapeWhiskyde(shop Shop) []Angebot {
//W.Valid_until = e.ChildText(".article-price-special")
})
+ e.ForEach(".article-amount", func(i int, e *colly.HTMLElement) {
+ text_noisy := e.ChildText("span")
+
+ if strings.Contains("Liter", text_noisy) {
+ W.Volume, err = extract_volume(text_noisy)
+ if err != nil {
+ log.Fatal(err)
+ }
+ } else {
+ W.Abv, err = extract_abv(text_noisy)
+ if err != nil {
+ log.Fatal(err)
+ }
+ }
+ })
+ if W.Volume == 0 {
+ log.Println(W.Name + " kein Volume erkannt")
+ }
+ if W.Abv == 0 {
+ log.Println(W.Name + " kein Abv erkannt")
+ }
+
W.Shop = shop.Id
W.Spirit_type = "Whisky"
+ W.Base_price, err = convert_price(e.ChildText(".article-unitprice-default"))
+ if err != nil {
+ log.Fatal(err)
+ }
+
Whiskys = append(Whiskys, W)
})