C# Is there a LINQ to HTML, or some other good .Net HTML manipulation API?

前端 未结 5 1378
轮回少年
轮回少年 2020-11-30 07:42

I have a C# WPF application that needs to consume data that is exposed on a webpage as a HTML table.

After getting inspiration from this url I tried using Linq to X

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 08:05

    Even though it's not LINQ based, I suggest researching the HTML Agility Pack from CodePlex.

    Note: Html Agility Pack now supports Linq to Objects (via a LINQ to Xml Like interface)

    From the HTML Agility Pack page:

    This is an agile HTML parser that builds a read/write DOM and supports plain XPATH or XSLT (you actually don't HAVE to understand XPATH nor XSLT to use it, don't worry...). It is a .NET code library that allows you to parse "out of the web" HTML files. The parser is very tolerant with "real world" malformed HTML. The object model is very similar to what proposes System.Xml, but for HTML documents (or streams).

提交回复
热议问题