diff options
Diffstat (limited to 'crawler')
| -rw-r--r-- | crawler/shop_rumundco.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/crawler/shop_rumundco.go b/crawler/shop_rumundco.go index 45069c2..275e60a 100644 --- a/crawler/shop_rumundco.go +++ b/crawler/shop_rumundco.go @@ -10,6 +10,7 @@ import ( func (app *App) ScrapeRumundCo(shop Shop) []Angebot { + // kf=29 means Whisky Shop_url := "https://www.rumundco.de/navi.php?q=4&kf=29&kk-suesse-von=0&kk-suesse-bis=100&kk-milde-von=0&kk-milde-bis=100&kk-wuerze-von=0&kk-wuerze-bis=100&kk-frucht-von=0&kk-frucht-bis=100&kk-torf-von=0&kk-torf-bis=100&hf=0&af=90&Sortierung=11&a=350" Whiskys := []Angebot{} @@ -51,7 +52,7 @@ func (app *App) ScrapeRumundCo(shop Shop) []Angebot { abv_noisy := r_abv.FindString(whisky_name) e.ForEach(".price_wrapper", func(i int, e *colly.HTMLElement) { - regular_price := e.ChildText("del.value") + regular_price := e.ChildText(".instead_of") if "" == regular_price { W.error_msg = "Rum & Co: No regular price found" W.error_ctx = regular_price @@ -146,9 +147,12 @@ func (app *App) ScrapeRumundCo(shop Shop) []Angebot { e.ForEach("tr", func(i int, e *colly.HTMLElement) { text_noisy := e.ChildText("th") - if strings.Contains(text_noisy, "Genauer Inhalt:") { + switch text_noisy { + case "Genauer Inhalt:": e.Request.Ctx.Put("volume", e.ChildText("td")) - } else if strings.Contains(text_noisy, "Alkoholgehalt in %:") { + case "Inhalt:": + e.Request.Ctx.Put("volume", e.ChildText("td")) + case "Alkoholgehalt in %:": e.Request.Ctx.Put("abv", e.ChildText("a")) } }) |
