diff options
| -rw-r--r-- | crawler/shop_whiskyzone.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/crawler/shop_whiskyzone.go b/crawler/shop_whiskyzone.go index fa9d764..7ac8ac6 100644 --- a/crawler/shop_whiskyzone.go +++ b/crawler/shop_whiskyzone.go @@ -38,6 +38,7 @@ func (app *App) ScrapeWhiskyzone(shop Shop) []Angebot { if "sold_out" == e.Request.Ctx.Get("sold_out") { W.Println("Whiskyzone: Sold out") + e.Request.Ctx.Put("sold_out", "") return } @@ -131,7 +132,7 @@ func (app *App) ScrapeWhiskyzone(shop Shop) []Angebot { }) // ABV - e.ForEach(".base-info--entry.entry-attribute", func(i int, e *colly.HTMLElement) { + e.ForEach(".base-info--entry.entry--attribute1", func(i int, e *colly.HTMLElement) { text_noisy := e.ChildText(".entry--content") if strings.Contains(text_noisy, "Alkoholgehalt") && strings.Contains(text_noisy, "%") { @@ -145,13 +146,16 @@ func (app *App) ScrapeWhiskyzone(shop Shop) []Angebot { }) // Product not found - c.OnHTML(".detail-error--headline", func(e *colly.HTMLElement) { + c.OnHTML(".alert.is--error > .alert--content", func(e *colly.HTMLElement) { if e.Request.URL.String() == Shop_url { return } - e.Request.Ctx.Put("sold_out", "sold_out") + if strings.Contains(e.Text, "Dieser Artikel steht derzeit nicht zur Verfügung!") { + e.Request.Ctx.Put("sold_out", "sold_out") + } + return }) err := c.Visit(Shop_url) |
