Answer the question
In order to leave comments, you need to log in
How to extract information from the second div in the GO parser if there are several of them with the same class?
Good afternoon. I do a search by class container
, and then I need to pull out information only from the second div with the class . profile-page-section
From the first one, you can pull out the method First()
, but what about the second one? Second() does not exist as far as I understand.
docInner.Find(".container").Each(func(i int, s *goquery.Selection) {
longDescription = s.Find(".profile-page-section").First().Text()
})
Answer the question
In order to leave comments, you need to log in
I could be wrong but [1] instead of First just check the length of the collection
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question