2 Replies - 6664 Views - Last Post: 29 October 2012 - 07:45 PM Rate Topic: -----

#1 complete  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 103
  • Joined: 12-April 07

How do I expose the LoadCompleted method in the WebBrowser class ?

Posted 27 October 2012 - 09:46 PM

How do I expose the LoadCompleted method in the WebBrowser class in WPF C#?

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.

Is This A Good Question/Topic? 0
  • +

Replies To: How do I expose the LoadCompleted method in the WebBrowser class ?

#2 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4429
  • View blog
  • Posts: 7,698
  • Joined: 08-June 10

Re: How do I expose the LoadCompleted method in the WebBrowser class ?

Posted 29 October 2012 - 07:47 AM

I've already warned you about this once. Stop posting help questions in the Advanced Discussion area. That's only for discussion topics, not for help questions.



Also, you're not going to be able to just get a text dump of the rendered source, because it doesn't exist. IE can show you a tree-view of it rendered with the F12 tools, and you could save that, but there's no direct interface to get that as one big dump.

What you can do is interact with the Document object returned by the WebBrowser:

http://social.msdn.m...83-3ef136e57697

It's a real pain.
Was This Post Helpful? 0
  • +
  • -

#3 complete  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 103
  • Joined: 12-April 07

Re: How do I expose the LoadCompleted method in the WebBrowser class ?

Posted 29 October 2012 - 07:45 PM

ok
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1