How can I get all content within <td> tag using a HTML Agility Pack?

Posted by Bob Dylan on Stack Overflow See other posts from Stack Overflow or by Bob Dylan
Published on 2010-06-12T05:26:19Z Indexed on 2010/06/12 6:03 UTC
Read the original article Hit count: 313

So I'm writing an application that will do a little screen scrapping. I'm using the HTML Agility Pack to load an entire HTML page into an instance of HtmlDocoument called doc. Now I want to parse that doc, looking for this:

<table border="0" cellspacing="3">
<tr><td>First rows stuff</td></tr>
<tr>
<td> 
The data I want is in here <br /> 
and it's seperated by these annoying <br /> 's.

No id's, classes, or even a single <p> tag. </p> Just a bunch of <br />  tags.
</td> 
</tr> 
</table> 

So I just need to get the data within the 2nd row. How can I do this? Should I use a regex or something else?

© Stack Overflow or respective owner

Related posts about c#

Related posts about screen-scraping