Answer the question
In order to leave comments, you need to log in
How to select tr and td correctly in goquery?
The site responds like this:
<tr >
<td class="num">
</td>
<td class="co">
</td>
<td class="pla">
</td>
<td class="res">
</td>
</tr>
<tr class="odd" >
<td class="num">
</td>
<td class="co">
</td>
<td class="pla">
</td>
<td class="res">
</td>
</tr>
<tr >
<td class="num">
</td>
</td>
<td class="pla">
</td>
<td class="res">
</td>
</tr>
query.Find("tr").Each(func(index int, trhtml *goquery.Selection) {
fmt.Printf("%d:%s\n", index, trhtml.Text())
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question