Scrape that screen with LINQ

Description

        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.

Tag:

C4FNews

The Discussion

  • User profile image
    leblanc meneses

    why?

    . 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
    Clint

    Not every solution can be solved with RegEx or XSLT.

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.