I've having some issues (probably misunderstanding soemthing most likely) when reading the dom and using cheerio.js to do so from with a simple node.js app.
I'm using request to grab the html from a website and cheerio to navigate it find certain portions. As and example the html looks like this....
<html>
<body>
<table>
<tr><td class="title"/>Title 1</td></tr>
<tr>
<td>
<table>
<tr>
<td class="dl">Some Name1</td>
</tr>
</table>
<td>
</tr>
<tr><td class="title"/>Title 2</td></tr>
<tr>
<td>
<table>
<tr>
<td class="dl">Some Name2</td>
</tr>
</table>
<td>
</tr>
<tr><td class="title"/>Title 3</td></tr>
<tr>
<td>
<table>
<tr>
<td class="dl">Some Name3</td>
</tr>
</table>
<td>
</tr>
</table>
</body>
</html>
What want to do it find all instances of the td with class title grab the title text and thne for each one of those then grab the name at the td with class dl.
So far
$('td[class=title]')
will get me all the td with that class and using the each function
$('td[class=title]').each(function(i, elem)
lets me grab the text from each but I want to grab the title then the next td with the dl class before moving on to the next title.
I guess what I'm really asking is can I get that td.dl element while in the $('td[class=title]'.each function?