Original post

Do you know if through Colly it is possible to filter a named “tr” tag?

I want to filter only the following tag:

r/golang - Help me filter a tag with Colly

The only way I can access it, was returning all the elements:

        c.OnHTML("table[id=stats] tbody", func(e *colly.HTMLElement) {
                e.ForEach("tr", func(_ int, elem *colly.HTMLElement) {
                        println(elem.ChildText("th[data-stat=season]"))
                })
        })

        c.Visit("https://www.basketball-reference.com/leagues/")