Parsing html with the HTML Agility Pack and Linq

前端 未结 5 1585
别跟我提以往
别跟我提以往 2021-02-02 18:21

I have the following HTML

(..)

 
   Test1 
   Data 
  

        
5条回答
  •  有刺的猬
    2021-02-02 18:55

    I can recommend one of two ways:

    http://htmlagilitypack.codeplex.com/, which converts the html to valid xml which can then be queried against with OOTB Linq.

    Or,

    Linq to HTML (http://www.superstarcoders.com/linq-to-html.aspx), which while not maintained on CodePlex ( that was a hint, Keith ), gives a reasonable working set of features to springboard from.

提交回复
热议问题