kill4 Posted December 29, 2009 Posted December 29, 2009 ok, i'm having some problems getting the html source from my webbrowser control. I'm trying to get the source in the DocumentCompleted event of the webbrowser. The code i'm using is this Dim myHTML As String = wbNav.DocumentText Debug.Print(myHTML) When the vb.net hits that line i get this error "The system cannot find the file specified. (Exception from HRESULT: 0x80070002)" it's a FileNotFoundException error. I've searched google, and everyone says to use this code. But it's just not working out for me. Is there another way to get the html? or is something wrong with this code? Quote
Leaders snarfblam Posted December 29, 2009 Leaders Posted December 29, 2009 If you look at the call stack (enable "Show External Code"), in what method is the exception being thrown? Or maybe just copy/paste the call stack. I don't know if the error is related to a file cacheing issue or what, but that kind of info can help. Quote [sIGPIC]e[/sIGPIC]
kill4 Posted January 3, 2010 Author Posted January 3, 2010 > Creator.exe!WindowsApplication1.frmCreator.wbNav_DocumentCompleted(Object sender = {System.Windows.Forms.WebBrowser}, System.Windows.Forms.WebBrowserDocumentCompletedEventArgs e = {System.Windows.Forms.WebBrowserDocumentCompletedEventArgs}) Line 47 + 0x18 bytes Basic I'm pretty new to vb.net programming so bare with me :) This was output in the call stack window. Sorry for the late response. I like your avatar meatwad is the man, lol, i actually have a meatwad avatar in another forum i post on. Thanks.. Quote
kill4 Posted January 4, 2010 Author Posted January 4, 2010 Well I finally got it to work. with the code below Dim myHTML As String = wbNav.Document.Body.InnerHtml Debug.Print(myHTML) Just thought i would post a update i know people come here via google, searching for a answer to this question so :) All i did was change wbNav.DocumentText to wbNav.Document.Body.InnerHtml And all was good. 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.