I am trying to write a C# program in wpf that retrieves the content of a web page.

1 posts, 0 answers
  1. William
    William avatar
    14 posts
    Member since:
    Jan 2010

    Posted 27 Oct 2012 Link to this post

    I am trying to write a C# program in wpf that retrieves the content of a web page.

    The first thing I tried was to try the WebRequest and WebResponse classes.  This did not provide the actual displayed content.  WebResponse reveils the HTML code that is sent to the browser.  But I discovered that, while the page is being loaded by the browser, javascript can change what content is finally displayed in the browser.

    So I decided to use the WebBrowser class.

    Immediately I found that there are two WebBrowser classes.  Thee is the one that is documented for WinForms and there is another that is documented for WPF.  I need to understand the one documented for WPF.  What I think I neeed to know what to do is to retrieve code after the "LoadCompleted" method is caused.  But I do not know how to this and I cannot find any example demonstrating how this is done.

     

Back to Top