locked
How to get html source before OnDocumentComplete? RRS feed

  • Question

  • Hi all, I write a browser program with IWebBrowser2 control. I get html source with IHTMLDocument2 at the event OnDocumentComplete, but it's a little late. How can I get html source just after IE download it?
    benny
    Thursday, December 10, 2009 8:59 AM

All replies

  • You can get the HTML from a proxy, if you can convince the user to use your proxy. 

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP
    Thursday, December 10, 2009 11:50 PM
  • Doesn't IHTMLXXX interface or event provide such method?
    benny
    Sunday, December 13, 2009 8:17 AM
  • If you want to use DOM, wait until the webbrowser's status is ready, preferably in the DocumentComplete event handler.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP
    Sunday, December 13, 2009 12:39 PM
  • It seems  OnProgressChange is the right way.

     if ( (Progress == ProgressMax) && (Pogress != -1 ) )
    {
          // get html source from IHTMLDocument2
    }

    Am I right?

    benny
    Wednesday, December 16, 2009 9:41 AM