c# - Getting text inside table -


I have such a table and I just want to get the Foo company bus text from the TD tag. How do I get it?

  & lt; Table class = "left_company" & gt; & Lt; TR & gt; & Lt; Td style = "border-right: moderate none; border description =" # ff 20000 "align =" left "width =" 291 "bg = =" # ff 20000 "> gt; table cell area =" 0 " Cellpadding = "0" width = "103%" border = "0" & ​​amp; tr style = "cursor: hand" onclick = "window.open ('http://www.foo.com' ) "Font-weight: 700" face = "font style =" font-weight "=" font-weight: "=" font "=" center = "align =" left "colspan =" 2 "& gt; font style =" title_post " Tahoma "color =" #FFFFFF "Size =" 2 "> *** FOO Company ***      

I I am using the code but nS is empty.

  doc = hw.load ("http: //www.foo.aspx? Page =" + J); foreach (HtmlNode link In doc.DocumentNode.SelectNodes ("// table [@ class = 'left_company']"))) {nS = doc.DocumentNode.SelectNodes ("// td [@ class = 'title_post']"};}    

  var text = doc.DocumentNode.Descendants () .FirstOrDefault (n = Gt; N.Attributes ["class"]! = Null & amp; Amp; Amp; N. Attributes ["class"]. Value == "title_post"). Element ("font"). Intertext;   

or

  var text2 = doc.DocumentNode.SelectNodes ("// td [@ class = 'title_post'] / font") first () .interText;    

Comments