views:

57

answers:

2

hi all! i'm trying to parse an html page with XPathDocument, but gives error 'cause the html is not an xml... is there a way to do this or not?

+4  A: 

Should use HtmlAgilityPack. Still the best!

pinichi
+1  A: 

Use something like Html Agility Pack which can load your html into a DOM object which can be traversed with for example xpath queries.

Unless your html is in fact xhtml, it is usually not a valid xml structure with correct opening and ending node tags.

Mikael Svenson