From 29aa3ca0af871ea605a826d32d157441c395b569 Mon Sep 17 00:00:00 2001 From: Maximilian Möhring Date: Wed, 15 May 2019 14:41:20 +0200 Subject: Workaround for a glitch in the d12 api. (crawler) --- crawler/shop_drankdozijn.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'crawler') diff --git a/crawler/shop_drankdozijn.go b/crawler/shop_drankdozijn.go index 2383ec2..28f79b2 100644 --- a/crawler/shop_drankdozijn.go +++ b/crawler/shop_drankdozijn.go @@ -115,6 +115,17 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot { c := app.customCollector([]string{"drankdozijn.de", "drankdozijn.nl"}) + c.OnHTML("span.product_title", func(e *colly.HTMLElement) { + + Trace(nil, "D12: On span.product_title: "+e.Text) + + if e.Text != W.Name { + W.Trace("Name changed from: " + W.Name + " to " + e.Text) + W.Name = e.Text + } + + }) + c.OnHTML(".product_top", func(e *colly.HTMLElement) { if strings.Contains(W.Name, "+ gratis") || strings.Contains(W.Name, "& gratis") { -- cgit v1.2.3