summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhorus2018-02-15 15:02:41 +0100
committerhorus2018-02-15 15:02:41 +0100
commit933978a5f244e6907c4ef13388a0829839037978 (patch)
tree17049d057893a392ffc24f6f8ce3f800b504f230
parent8ee15ccf1f5ee54efc2f973ff59b5cc58dff44fa (diff)
downloadalkobote-933978a5f244e6907c4ef13388a0829839037978.tar.gz
Bugfix. (crawler)
-rw-r--r--crawler/scrape.go4
-rw-r--r--crawler/shop_whiskyde.go4
-rw-r--r--crawler/shops.go2
3 files changed, 7 insertions, 3 deletions
diff --git a/crawler/scrape.go b/crawler/scrape.go
index b183e24..18736fe 100644
--- a/crawler/scrape.go
+++ b/crawler/scrape.go
@@ -57,8 +57,8 @@ func ScrapeShop(shop Shop) []Angebot {
return ScrapeWhic(shop)
case "Whisky.de":
return ScrapeWhiskyde(shop)
- case "Whiskysite.nl":
- return ScrapeWhiskysitenl(shop)
+ //case "Whiskysite.nl":
+ // return ScrapeWhiskysitenl(shop)
case "Whisky World":
return ScrapeWhiskyworld(shop)
case "Whiskyzone":
diff --git a/crawler/shop_whiskyde.go b/crawler/shop_whiskyde.go
index 77e4bcb..6038c11 100644
--- a/crawler/shop_whiskyde.go
+++ b/crawler/shop_whiskyde.go
@@ -54,6 +54,10 @@ func ScrapeWhiskyde(shop Shop) []Angebot {
text_noisy := e.ChildText(".article-amount")
+ if !strings.Contains(text_noisy, "Liter") {
+ return
+ }
+
abv_noisy := strings.TrimSpace(strings.SplitAfter(text_noisy, "Liter")[1])
W.Volume, err = extract_volume(text_noisy)
if err != nil {
diff --git a/crawler/shops.go b/crawler/shops.go
index 63c98ba..9cad602 100644
--- a/crawler/shops.go
+++ b/crawler/shops.go
@@ -7,7 +7,7 @@ import (
func (app *App) insertShops() error {
shops := getShopsFromStruct()
- query := `INSERT IGNORE INTO shop (name, url, short_url, logo_url, shipping_costs, free_shipping) VALUES(?, ?, ?, ?, ?)`
+ query := `INSERT IGNORE INTO shop (name, url, short_url, logo_url, shipping_costs, free_shipping) VALUES(?, ?, ?, ?, ?, ?)`
for _, v := range shops {