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,

If you have the page loaded in a web browser control, then you should be
able to get the IHTMLWindow2 interface that represents the main page in the
web browser control. Once you have that, you can use the frames property to
access the frames and the content in each of them.

Hope this helps.
 
Nicholas,

Thanks for your reply.

mshtml.HTMLDocument htm = (mshtml.HTMLDocument)axWebBrowser1.Document;
I can use "htm.frames.length.ToString()" to get the frame's length. But
while I try to use "htm.frames[2].Document.documentElement.innerText" to get
the HTML source, it said "Cannot apply indexing with [] to an expression of
type 'mshtml.FramesCollection'". Do you know how to resolve it?

Thanks,
Simon

Nicholas Paldino said:
Simon,

If you have the page loaded in a web browser control, then you should be
able to get the IHTMLWindow2 interface that represents the main page in the
web browser control. Once you have that, you can use the frames property to
access the frames and the content in each of them.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Simon said:
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
 
Back
Top