summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhorus2018-06-15 16:19:58 +0200
committerhorus2018-06-15 16:19:58 +0200
commitc59d15dfc04e0fb75c8132a3ce778dcf801645c1 (patch)
tree0cda51a4c5506027d0a6b6ea3af7b98e3cac02d8
parentae873c6dbd8ee11e0d8beb88d76c8bf4258286b6 (diff)
downloadalkobote-c59d15dfc04e0fb75c8132a3ce778dcf801645c1.tar.gz
Fix because changed html. (crawler)
-rw-r--r--crawler/shop_whiskyde.go1
-rw-r--r--crawler/shop_whiskyworld.go5
2 files changed, 5 insertions, 1 deletions
diff --git a/crawler/shop_whiskyde.go b/crawler/shop_whiskyde.go
index 0245c85..7117d71 100644
--- a/crawler/shop_whiskyde.go
+++ b/crawler/shop_whiskyde.go
@@ -19,6 +19,7 @@ func (app *App) ScrapeWhiskyde(shop Shop) []Angebot {
c.OnHTML(".is-buyable", func(e *colly.HTMLElement) {
if e.Request.URL.String() != Shop_url {
+ Debug(nil, "Whisky.de: Request url ("+e.Request.URL.String()+") is not shop url ("+Shop_url+").")
return
}
diff --git a/crawler/shop_whiskyworld.go b/crawler/shop_whiskyworld.go
index af97511..f617ebb 100644
--- a/crawler/shop_whiskyworld.go
+++ b/crawler/shop_whiskyworld.go
@@ -106,7 +106,10 @@ func (app *App) ScrapeWhiskyworld(shop Shop) []Angebot {
})
- W.Image_url = "https:" + e.ChildAttr("img", "data-src")
+ W.Image_url = e.ChildAttr("img", "data-src")
+ if !strings.HasPrefix(W.Image_url, "https:") {
+ W.Image_url = "https:" + W.Image_url
+ }
e.Request.Visit(W.Url)
W.Website = e.Request.Ctx.Get("website")