How to read HTML

P

pechoi

Hi all,
My function looks like:
Function getWebPage()
Dim loInet As InternetExplorer
Dim lsURL As String
Dim loObject As Object


Set loInet = New InternetExplorer
loInet.Visible = True

lsURL = "http://finance.yahoo.com/"

loInet.Navigate lsURL

End Function

I don't know how to read the HTML site I just opened.

THx
 
J

Jake Marx

Hi,

You can use the XMLHTTP object to read the HTML:

Public Function gsGetHTML(rsURL As String) As String
Dim x As Object

Set x = CreateObject("Microsoft.XMLHTTP")

With x
.Open "GET", rsURL
.send
Do Until .ReadyState = 4
DoEvents
Loop
gsGetHTML = .ResponseText
End With

Set x = Nothing
End Function

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]
 
P

pechoi

Thx a lot!
However, your function only print out limit of string (I printed out
..ResponseText). So it only gets 256 chararacters (i am just guessing).
Do you know other way to print out more?

Thx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top