borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (how to control ftp transfer (using wininet.dll))Next Topic (Access Google Through VB) New Topic New Poll Post Reply
AndreaVB Forum : Internet Applications : HTMLDocument.toString (MS WebBrowser Control)
Poster Message
tintino
Level: Guest


icon HTMLDocument.toString (MS WebBrowser Control)

Ok i figured out a way for my problem (other thread below)...took me 6 hours of searching...but now...

on a form on which i have the WebBrowser Control (WebBrowser1) and a text box (Text1)



'******* begin code ***********
'load page
WebBrowser1.Navigate "blah.com"

'wait for it to load
Call WaitForLoad()

'get reference to the html document in the WebBrowser
Dim d As HTMLDocument
Set d = WebBrowser1.Document

'load the HTML Code of the page in the textbox (I WISH)
Text1 = d.toString
'******* end of code **********


Text1 then displays "[Object]"
How do i actually load the html code into a string so i can do some parsing?
HELP!!!!



.

28-02-2003 at 06:16 AM
| Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: HTMLDocument.toString (MS WebBrowser Control)

i'm not sure if this is what you want... but this code will get you the source of a webpage

' just place a microsft internet transfer control 6.0 on your form

'this will get the html source code into a string
Dim HTMLSourceCode As String
Inet1.OpenURL ("http://www.whatever.com")
HTMLSourceCode = Inet1.OpenURL


tell us if we got it right, okay?

NOTE: in the code... please remove the semicolon after ...tever.com



[Edited by vbgen on 01-03-2003 at 12:03 AM GMT]

[Edited by admin on 28-02-2003 at 05:45 PM GMT]

____________________________
Been busy trying to take a second degree <--it's not working out...

28-02-2003 at 04:00 PM
View Profile Send Email to User Show All Posts | Quote Reply
claw
Level: Guest

icon Re: HTMLDocument.toString (MS WebBrowser Control)

Try the following:

str = WebBrowser1.document.documentElement.outerHTML

HTH

Charles

25-05-2003 at 09:42 PM
| Quote Reply
AndreaVB Forum : Internet Applications : HTMLDocument.toString (MS WebBrowser Control)
Previous Topic (how to control ftp transfer (using wininet.dll))Next Topic (Access Google Through VB) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder