i am working on small web scraping application using go language and colly web scraping framework which is built in Go
here is the html code of website
<div clas="cc">
<div class="list">
<span class="countrybg" style="background-image: url(countryimage);"></span>
<span class="continet">Asia</span>
<span class="country">india</span>
</div>
<div class="list">
<span class="countrybg" style="background-image: url(countryimage);"></span>
<span class="continet">Africa</span>
<span class="country">Brazil</span>
</div>
</div>
now i want to fetch all the three span elements one by one and append to array
i tried with this code but it does not work but it return as AsiaAfrica
but i want the values separately and want to fetch the image url of countrybg class
c := make([]string, 10)
element.ForEach(".list span", func(_ int, elem *colly.HTMLElement) {
result := element.ChildText("span:nth-child(2)")
c = append(c, result)
})
the example output should be like
countrybg = ['image1url' ,'image2url']
continet = ['Asia' ,'Africa']
country = ['india' ,'Brazil']
can any one help to get this