开发者

c# parse html using XPathDocument

开发者 https://www.devze.com 2023-01-20 05:57 出处:网络
i\'m trying to parse an html page with XPathDocument, but gives error \'c开发者_如何学JAVAause the html is not an xml...

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

精彩评论

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

关注公众号