How to screen scrape in Silverlight

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bassem
    Contributor
    • Dec 2008
    • 344

    How to screen scrape in Silverlight

    Hey,

    I'm trying to get a string that represents the DOM of web pages using System.NET - The only way I know. I used WebClient.Downl oadStringAsync, but it acts very strange; sometimes gives result, but very short string! Does not the expected result from DownloadStringC ompleted event handler is the entire string of the web page, like using BugZilla? or View Source from any browser?, and sometimes it does not respond!

    Here is the code, anyway nothing new:
    Code:
     WebClient c = new WebClient();
                c.DownloadStringCompleted += new DownloadStringCompletedEventHandler(c_DownloadStringCompleted);
                c.DownloadStringAsync(new Uri("http://www.msn.com"));
    ....
    ...
            void c_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
            {
                MessageBox.Show(e.Result);
                //txtUrl.Text = e.Result;
            }
    Please, if you have any idea reply to me, if you have any other way to do a text scraping tell me!

    Thanks a lot, and I appreciate your help.
Working...