diff options
| author | horus_arch | 2018-02-10 12:27:25 +0100 |
|---|---|---|
| committer | horus_arch | 2018-02-10 12:27:25 +0100 |
| commit | 0dbc07daf301908e1b983fcf70a760ef8a29b898 (patch) | |
| tree | 64472bb992114efc1f825c2ce22c14b4a08aefa9 /crawler/shop_whiskyde.go | |
| parent | 217a36a1ef918bec39bf1485c6e4d5d8def58886 (diff) | |
| download | alkobote-0dbc07daf301908e1b983fcf70a760ef8a29b898.tar.gz | |
Improves whiskyde. (crawler)
Diffstat (limited to 'crawler/shop_whiskyde.go')
| -rw-r--r-- | crawler/shop_whiskyde.go | 27 |
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) }) |
