get sourcecode for HTML doc in axWebBrowser

S

Sandra Setz

Hi,

I'm trying to get the source-code from a document in the axWebBrowser
control.

When I try it using a blank page, like in the following code, innerHTML is
an empty string, which is correct.

wbKoersen.Navigate("about:blank")
Dim doc As mshtml.IHTMLDocument2 = wbKoersen.Document
Application.DoEvents()
Dim src As String = doc.body.innerHTML 'value of src = ""

But when I try it using an url, the value of doc is Nothing, so I can't
request the value of innerHTML either.

wbKoersen.Navigate("http://teletekst.nos.nl/tekst/543-01.html")
Dim doc As mshtml.IHTMLDocument2 = wbKoersen.Document
Application.DoEvents()
Dim src As String = doc.body.innerHTML 'value of doc = Nothing

Can anyone explain to me why? What is it that I am doing wrong? I am using
VB .NET.

Thanks in advance,
Sandra
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top