Extracting HTML table from XML node in C#

Mumappaks

New Member
I have the following HTML from within an XML node:\[code\]<table cellpadding="5"><tr><td><strong>Date </strong></td><td><strong>Event</strong></td><td><strong>Pro</strong></td><td><strong>Act</strong></td><td><strong>Prev</strong></td></tr><tr><td>Jun 8 12:30</td><td>Announcement</td><td>0.300 %</td><td>0.100 %</td><td>0.700 %</td></tr></table><br /><h2>News</h2><ul><li><a href="http://www.link1.com">News Text</a> Source <br/>Fri, Jun 8 2012, 12:34 GMT</li></ul><br /><div class="class1"><a href="http://link2.com"><img src="http://link3.com" border="0"></img></a>\[/code\]I need to be able to grab JUST the table. Unfortunately, all of this is inside of one XML node, so I can't use doc.SelectSingleNode any further. I'm going to parse the data that I get, but since the latter half of the elements change constantly, I have to be able to pass this to XElement.Parse as a variable and not as a static string.I'm using HtmlAgilityPack. If anyone knows how to extract the table only, I'd greatly appreciate a point in the right direction as I'm completely stuck. - Thanks.
 
Back
Top