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?

   - Full Name
   - John Doe

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) }) 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/36ed3d8a-5a55-4b9d-8183-b840ca7ae784n%40googlegroups.com.

Reply via email to