hi..
in vb6 i use this code to view data of web page..
"WebBrowser1.Document.documentelement.innertext"
But this code not show all data of all frames/ forms of webpage..
so what i do..??????????
Printable View
hi..
in vb6 i use this code to view data of web page..
"WebBrowser1.Document.documentelement.innertext"
But this code not show all data of all frames/ forms of webpage..
so what i do..??????????
Frames and IFrames are seperate HTML documents. They are not included with the main document; only their tags are included.
To address HTML code and text data in a frame you must address the frame element itself.
Didn't I show you this in another thread?
http://www.vbforums.com/showthread.php?t=558787
post #10, 1st code line
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)
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.
However, i'm not exactly sure about the syntax of frames() object, but i hope this works.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
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
yaaaaaa.....This is right way to do...:)Quote:
Originally Posted by Jim Davis
but ths code generate error
"Object doesn't support this property or method"
:mad:
Thank you .. for this example...Quote:
Originally Posted by jmsrickland
this example do all the things which i needed...:thumb:
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
??
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
'
'
yaaaaaaahhhhhhhhh...it is right....
Ok... thanks my problem now Resolved...
Thank again...:)