diff options
| author | horus | 2018-02-12 22:54:55 +0100 |
|---|---|---|
| committer | horus | 2018-02-12 22:54:55 +0100 |
| commit | ca5ac0bcb9206e81faab60cc8a8d6da697bdfdbe (patch) | |
| tree | 57ef53c6cb19cc9b5d82ec21de0437b78cd9264e /crawler/shop_whiskyde.go | |
| parent | f4a905f93824b91a56b3fb7117438935ea16286f (diff) | |
| download | alkobote-ca5ac0bcb9206e81faab60cc8a8d6da697bdfdbe.tar.gz | |
Crawler saves whole webpage.
Diffstat (limited to 'crawler/shop_whiskyde.go')
| -rw-r--r-- | crawler/shop_whiskyde.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crawler/shop_whiskyde.go b/crawler/shop_whiskyde.go index b450c86..77e4bcb 100644 --- a/crawler/shop_whiskyde.go +++ b/crawler/shop_whiskyde.go @@ -81,9 +81,19 @@ func ScrapeWhiskyde(shop Shop) []Angebot { log.Fatal(err) } + e.Request.Visit(W.Url) + W.Website = e.Request.Ctx.Get("website") + Whiskys = append(Whiskys, W) }) + c.OnHTML("body", func(e *colly.HTMLElement) { + if e.Request.URL.String() == Shop_url { + return + } + e.Request.Ctx.Put("website", string(e.Response.Body)) + }) + c.Visit(Shop_url) return Whiskys |
