use AxWebBrowser to get the HTML source of a page in frameset?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

A frameset contains 3 html pages: page A, page B and page C. I need to get
the HTML source of page B. I tried to use AxWebBrowser to do that, but
failed. Do you have any idea?

Thanks,
Simon
 
Simon said:
A frameset contains 3 html pages: page A, page B and page C. I need to get
the HTML source of page B. I tried to use AxWebBrowser to do that, but
failed.

The code below is VB6 code, but it should work in VB.NET with slight
adaptions:

\\\
Private Sub Form_Load()
Call Me.WebBrowser1.Navigate("http://www.over-the-moon.org/dollz")
End Sub

Private Sub WebBrowser1_DownloadComplete()
Dim i As Integer
For i = 0 To Me.WebBrowser1.Document.frames.length - 1
Call MsgBox( _

Me.WebBrowser1.Document.frames(i).Document.documentElement.innerText _
)
Next i
End Sub
///

Alternatively, you can use 'WebClient.DownloadFile' for downloading the file
in frame B.
 
Herfried,

The following code are written in C#.NET.
mshtml.HTMLDocument htm = (mshtml.HTMLDocument)axWebBrowser1.Document;
While I tried to use "htm.frames(2).Document.documentElement.innerText" to
get HTML source, it said "Cannot apply indexing with [] to an expression of
type 'mshtml.FramesCollection'". Do you know how to resolve it?

Thanks,
Simon
 
Back
Top