Scrape that screen with LINQ

Published 29 April 08 03:27 PM | Coding4Fun 

        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.

Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# leblanc meneses said on May 8, 2008 2:19 PM:

why?

[quote]

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

[/quote]

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

# Coding4Fun said on May 16, 2008 3:48 PM:

Not every solution can be solved with RegEx or XSLT.

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required

Search

This Blog

Syndication

Page view tracker