Hello, I am new to golang, and am working on a small web scrapper project, where i crawl through a website for a guild that i'm associated with.
Ideally I would like to pull the data from each 'dl' (html below) and insert it into the MemberDetails Struct, however all attempts to parse the below html result in the following string being returned
Printout dt - 0: [Full nameRankPrimary position]
Do you have any advice on how I could get one element at a time?
Note: Library being used github.com/gocolly/colly
<div class="block-container"> <h3 class="block-formSectionHeader">Information</h3> <div class="block-body block-row"> <dl class="pairs pairs--columns rosters-rows"> <dt>Full name</dt> <dd>John Doe</dd> </dl> <dl class="pairs pairs--columns rosters-rows"> <dt>Rank</dt> <dd>Rank #1</dd> </dl> <dl class="pairs pairs--columns rosters-rows"> <dt>Primary position</dt> <dd>General Staff</dd> </dl> </div>> </div> type MemberDetails struct { FullName string Rank string PrimaryPosition string } // ... detailCollector.OnHTML("div.block-container div.block-body:first-of-type", func(h *colly.HTMLElement) { selection := h.DOM val := selection.Find("dl > dt").Text() fmt.Printf("Printout dt - 0: %s \n", val) })