Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

  • Leaders
Posted
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.
[sIGPIC]e[/sIGPIC]
Posted

> 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..

Posted

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.

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...