Re: "WebBrowser1.Document.documentelement.innertext" not show all data of diff Frame/form
your means if a webpage contain N different frames then we can't know innertext of those N frame by single function..??
By this code know any specific frame's data
"WebBrowser1.Document.frames(i).Document.documentelement.innertext"
but if i use this code to know data of a webpage (which contain data in more than one frame) this it is not clear that how many time i execute this code..?? for frame-1, frame-2 , frame-2....frame-n
where n=?? (not know for different website)
Last edited by nilesh16782; Feb 28th, 2009 at 08:52 AM.
Mars base one Username: Jim Davis Password: yCrm33
Posts
1,284
Re: "WebBrowser1.Document.documentelement.innertext" not show all data of diff Frame/form
The .innerText property contains the textural content of your page, excluding the html tags. If you just want to see the html tags, including the form's content, you have to use the .innerHtml or .outerHtml properties.
Use the For Each syntax to get each frames your page have.
Code:
Dim oFrame as Object
For Each oFrame in WebBrowser1.Document.frames
'oFrame will be one single frame, that you can use to extract/modify its content
debug.print oFrame.innerHtml
Next
However, i'm not exactly sure about the syntax of frames() object, but i hope this works.
Re: "WebBrowser1.Document.documentelement.innertext" not show all data of diff Frame/form
Here's a simple sample to experiment with. If you don't know the name of the frame thenuse it's index value instead. This example shows you how to get the HTML of a frame. I think with a little effort and forthought on your part you should be able to figure out how it works
Last edited by jmsrickland; Mar 1st, 2009 at 03:33 AM.
Re: "WebBrowser1.Document.documentelement.innertext" not show all data of diff Frame/form
Originally Posted by Jim Davis
Code:
Dim oFrame as Object
For Each oFrame in WebBrowser1.Document.frames
'oFrame will be one single frame, that you can use to extract/modify its content
debug.print oFrame.innerHtml
Next
However, i'm not exactly sure about the syntax of frames() object, but i hope this works.
yaaaaaa.....This is right way to do...
but ths code generate error
"Object doesn't support this property or method"
Re: "WebBrowser1.Document.documentelement.innertext" not show all data of diff Frame/form
Originally Posted by jmsrickland
Here's a simple sample to experiment with. If you don't know the name of the frame thenuse it's index value instead. This example shows you how to get the HTML of a frame. I think with a little effort and forthought on your part you should be able to figure out how it works
Thank you .. for this example...
this example do all the things which i needed...
In this example can i put a button which can show all three frames innertext...
by using loop like
dim f as object
For each f in madocument.document.frames
'code
next
Re: "WebBrowser1.Document.documentelement.innertext" not show all data of diff Frame/form
I was only able to get this to work. Add this code to a Button control to the project I gave you in that zip file.
Code:
'
'
For i = 0 To WebBrowser1.Document.frames.length - 1
Frames_HTML = WebBrowser1.Document.frames(i).Document.documentElement.innerHTML
Form2.Text1.Text = Frames_HTML
Form2.Caption = "Frame Page HTML Source"
Form2.Show
MsgBox "Click OK to see next frame HTML"
Next
'
'
Last edited by jmsrickland; Mar 1st, 2009 at 04:46 PM.