summaryrefslogtreecommitdiff
path: root/crawler
diff options
context:
space:
mode:
Diffstat (limited to 'crawler')
-rw-r--r--crawler/shop_bottleworld.go4
-rw-r--r--crawler/shop_drankdozijn.go8
-rw-r--r--crawler/shop_rumundco.go9
3 files changed, 17 insertions, 4 deletions
diff --git a/crawler/shop_bottleworld.go b/crawler/shop_bottleworld.go
index 0f1a301..2c6f734 100644
--- a/crawler/shop_bottleworld.go
+++ b/crawler/shop_bottleworld.go
@@ -84,6 +84,10 @@ func (app *App) ScrapeBottleWord(shop Shop) []Angebot {
W.Spirit_type = e.Request.Ctx.Get("spirit_type")
W.Website = e.Request.Ctx.Get("website")
+ if W.Original_price == 0 {
+ W.Println("Bottleworld: Original price is zero.")
+ return
+ }
Whiskys = append(Whiskys, W)
})
diff --git a/crawler/shop_drankdozijn.go b/crawler/shop_drankdozijn.go
index 7a9e786..d6b2f62 100644
--- a/crawler/shop_drankdozijn.go
+++ b/crawler/shop_drankdozijn.go
@@ -118,7 +118,6 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot {
// TODO
panic(err)
}
- log.Println(W.Original_price)
W.Discounted_price, err = convert_price(fmt.Sprintf("%.2f", api_data.SalePrice))
if err != nil {
@@ -266,7 +265,12 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot {
}
}
}
- W.Debug("DEBUG OFFER")
+
+ //W.Debug("DEBUG OFFER")
+ if W.Abv == 0 {
+ W.Println("Drankdozijn: Abv is zero")
+ continue
+ }
Offers = append(Offers, W)
}
diff --git a/crawler/shop_rumundco.go b/crawler/shop_rumundco.go
index c9a61a2..7ce5c29 100644
--- a/crawler/shop_rumundco.go
+++ b/crawler/shop_rumundco.go
@@ -125,7 +125,7 @@ func (app *App) ScrapeRumundCo(shop Shop) []Angebot {
})
// Rum & Co uses pagespeed
- image_url_noisy := e.ChildAttr("img", "src")
+ image_url_noisy := e.ChildAttr("img", "data-src")
if strings.Contains(image_url_noisy, "pagespeed") {
r_pagespeed, err := regexp.Compile(`jpg(\.pagespeed.+)$`)
@@ -176,7 +176,12 @@ func (app *App) ScrapeRumundCo(shop Shop) []Angebot {
}
W.Website = e.Request.Ctx.Get("website")
- Whiskys = append(Whiskys, W)
+ if W.Original_price == 0 {
+ W.Println("Rum & Co: Original price is zero")
+ return
+ } else {
+ Whiskys = append(Whiskys, W)
+ }
})
c.OnHTML("#table-collapse .product-attributes table", func(e *colly.HTMLElement) {