Extract multiple values from html page for c#

前端 未结 2 1472
说谎
说谎 2021-01-29 08:32

I have this from html page source

相关标签:
2条回答
  • 2021-01-29 08:46

    HTML Agility Pack is a great tool for manipulating and working with HTML: http://htmlagilitypack.codeplex.com/

    It could at least make grabbing the values you need and doing the replaces a little easier.

    Contains links to using the HTML Agility Pack: How to use HTML Agility pack

    0 讨论(0)
  • 2021-01-29 08:51

    You can do it like this using htmlAgilityPack:

    HtmlDocument doc = new HtmlDocument();
    doc.Load(yourStream);
    
    List<string> lst=doc.DocumentNode.SelectNodes("//h5[class='icn-venue']")
                        .Select(x=>x.InnerHtml)
                        .ToList();
    
    0 讨论(0)
提交回复
热议问题