Open winston-bosan opened 2 years ago
cases.OnHTML("div.col-result", func(e *colly.HTMLElement) {
log.Println("Case result found:", e)
e.ForEach("a.cta-primary", func(_ int, e *colly.HTMLElement) {
log.Println(e.Attr("href"))
})
})
is this what you're trying to do?
cases.OnHTML("div.col-result", func(e *colly.HTMLElement) { log.Println("Case result found:", e) e.ForEach("a.cta-primary", func(_ int, e *colly.HTMLElement) { log.Println(e.Attr("href")) }) })
is this what you're trying to do?
Yes it is. I am grateful for your time to write it out. However, as I said in the "why not..." section, because I have a specific agenda in mind, I wonder if it is possible to feed the HTML to another collector.
TLDR: How would I pass a HTMLElement to a Collector? Instead of asking it to visit a URL?
"Why do you want it this way? Why not just...": Hey I totally get it. I could simply just have the 2nd collector logic embedded in the first cases.OnHTML call. However, because I am toying around with the idea of doing building JSON config files in real time into colly-based executables, I think this is a behavior I need to make it work.