Scrape that screen with LINQ

Sign in to queue


        Beth Massi has done something I know some of you C4F readers have been asking for.  Beth developed a quick and easy way to query a web site with LINQ to XML.  One of the commenter pointed out also you can do a HTML to XHTML conversion with this tool.

The trick to doing this is loading the HTML into an XElement, from there you strip out the unsupported XML entities, THEN LINQ the HTML to get the data you wanted.

Beth, the 15 minutes this took you just saved the Internet days of work on what I'd be would be a far more complex solution.



The Discussion

  • User profile image
    leblanc meneses


    . This seemed like the perfect opportunity to use LINQ to XML because the structure of the page was pretty well formed HTML.

    if it was well formed you should have captured your section and used xslt to do the transformation.

    if its malformed.. you need to learn regex!!!!! period.

    what a waste of time...  

  • User profile image

    Not every solution can be solved with RegEx or XSLT.

Add Your 2 Cents