getting the source code of a web page
IO got the address. I'm not sue if I can get the GPS address from here. the
zip code is passed to an activex utility and I don't think that is available
at this URL. To get the URL there is probably a Google utility that will do
thhis. I would have to look for it. Never tried it before.
Sub GetAddress()
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
URL = "http://www.ymca.net/maps/profile.aspx?assn=6757"
'get web page
IE.Navigate2 URL
Do While IE.readyState < 4 Or _
IE.Busy = True
DoEvents
Loop
Call Dump(IE)
a = 1
Set Title = IE.document.getElementsByTagName("Title")
YName = Title.Item(0).innertext
MsgBox (YName)
Set P = IE.document.getElementsByTagName("p")
Address = P.Item(1).innertext
MsgBox (Address)
IE.Quit
End Sub
Sub Dump(IE)
RowCount = 1
Cells.ClearContents
For Each itm In IE.document.all
Range("A" & RowCount) = itm.tagName
Range("B" & RowCount) = itm.ID
Range("C" & RowCount) = itm.className
Range("D" & RowCount) = Left(itm.innertext, 1024)
RowCount = RowCount + 1
Next itm
End Sub
|