开发者

c# parse html using XPathDocument

i'm trying to parse an html page with XPathDocument, but gives error 'c开发者_如何学JAVAause the html is not an xml... is there a way to do this or not?


Should use HtmlAgilityPack. Still the best!


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜