Trots att frågan är gammal så ger jag ett utförligt svar:
Kod:
Function BinaryGetURL(URL)
'Create an Http object, use any of the four objects
Dim Http
Set Http = CreateObject("Microsoft.XMLHTTP")
'Set Http = CreateObject("MSXML2.ServerXMLHTTP")
' Set Http = CreateObject("WinHttp.WinHttpRequest.5")
' Set Http = CreateObject("WinHttp.WinHttpRequest")
'Send request To URL
Http.Open "GET", URL, False
Http.Send
'Get response data As a string
BinaryGetURL = Http.ResponseBody
End Function
Function BinaryToString(Binary)
'Antonin Foller, http://www.pstruh.cz
'Optimized version of a simple BinaryToString algorithm.
Dim cl1, cl2, cl3, pl1, pl2, pl3
Dim L
cl1 = 1
cl2 = 1
cl3 = 1
L = LenB(Binary)
Do While cl1<=L
pl3 = pl3 & Chr(AscB(MidB(Binary,cl1,1)))
cl1 = cl1 + 1
cl3 = cl3 + 1
If cl3>300 Then
pl2 = pl2 & pl3
pl3 = ""
cl3 = 1
cl2 = cl2 + 1
If cl2>200 Then
pl1 = pl1 & pl2
pl2 = ""
cl2 = 1
End If
End If
Loop
BinaryToString = pl1 & pl2 & pl3
End Function
Och du lagrar hämtade sidan med:
Kod:
Dim url_to_get
url_to_get = "http://www.exempel.com/"
strURL = (BinaryToString(BinaryGetURL(url_to_get)))
Det mesta kommer från motobit.com.
Tänk bara på upphovsrätten när du använder detta för screenscraping.