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

前端 未结 5 1379
轮回少年
轮回少年 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:10

    HTML is rarely well-formed enough that you could reliably use LINQ to XML. It's conceivable that you might find an HTML "cleaner" that could fix the formatting well enough to be read, but there's not telling how robust it would be.

    I assume this is a "screenscraper" that reads from an HTML table over which you have no control. Don't stress over robustness in this case, screen-scraping is inherently brittle. If your requirements are set in stone, design the scraper to be easily updatable if/when the HTML you are scraping changes.

提交回复
热议问题