This project is read-only.

Tag TBody upsupported

Mar 9, 2011 at 5:11 AM

I've several problems with Tbody tags, I've seen that this tag isn`t in HtmlTags.


its very useful library for me, more simple than HtmlAgilityPack. Good job.!

Mar 9, 2011 at 2:23 PM

Hello ElPluto,

Part of system html's design is to only recoginze tags from the html 4.01 specification. Adding new tags is as simple as adding an inherited object (in this case TBody) to the tags.

I'll add the tag, and a test case for it. You should see that soon.



Mar 12, 2011 at 10:12 AM

Thanks kurtnelle.


Mar 20, 2011 at 6:33 PM

Hello kurnelle

I've downloaded current source with Tbody supported tags, but when I've tried to select nodes only work if I remove "tbody" parts from xpath expression.

I use firefox and xpather to get xpath. if I get "/html/body/table/tbody/tr[2]/td[3]/div/table/tbody/tr[4]/td/div/center/table[2]/tbody/tr/td/table/tbody/tr/td[3]/a"

Only works when I remove tbody parts: this work fine: "/HTMLDocument/html/body/table/tr[2]/td[3]/div/table/tr[4]/td/div/center/table[2]/tr/td/table/tr/td[3]/a" 


_document = new HtmlDocument( );
_document.LoadHTML( source );
var nodes = _document.SelectNodes("/HTMLDocument/html/body/table/tr[2]/td[3]/div/table/tr[4]/td/div/center/table[2]/tr/td/table/tr/td[3]/a");

Any idea!


Mar 20, 2011 at 6:54 PM

You'll need the HTMLDocument tag infront of the xpather path:


This element is added to the xml because bad html can have more than 1 root element (i.e. some people leave out the <html> tag);

Mar 20, 2011 at 7:01 PM

Hi kurtnelle,

Yes, if you see my post, I write and example (with /HTMLDocument) that only works without tbodys but tbodys exits in the original html document.

I apreciate that you answer quickly but is no necessary, you could take more time.


Mar 20, 2011 at 7:17 PM

Hello ElPluto,

What happens if you do //tbody


Mar 20, 2011 at 7:58 PM

Hello kurtnelle,

its very rare, on firefox in page source code does not exist any tbody but with developer tool (F12) tbody tags appear and xpather show them.

In my project, I use a windows form browser control, in source code document does not exist but when navigating the document through htmlElements tbody appears.

I dont understand it.

If I remove tbody tags from xpath works fine. I'll use in this manner!


Thanks Kurtnelle.