I am trying to get data with goquery from an HTML document. The HTML is structured like this:
<div class="container">
<div class="table-holder body">
<div class="simple-wrapper">
</div>
<div class="simple-mask">
<table>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="table-holder body">
<div class="simple-wrapper">
</div>
<div class="simple-mask">
<table>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
What I would like to get is the content of tbody of the first Node object. I am getting the first Node like this:
container := doc.Find(".container")
tableHolder := container.Find(".table-holder.body").Nodes[0]
But, since there is no Find
method on the Node
struct, I am wondering how can I then get the tbody
from the Node struct?