Server.Createobject("MSXML2.ServerXMLHTTP")

Server.Createobject("MSXML2.ServerXMLHTTP")

function getHTML (strUrl,fileName)

'gdebug filename
    Set xmlHttp = Server.Createobject("MSXML2.ServerXMLHTTP")
    xmlHttp.Open "GET", strUrl, False
    'xmlHttp.setRequestHeader "User-Agent", "asp httprequest"
    'xmlHttp.setRequestHeader "content-type", "application/x-www-form-urlencoded"
    xmlHttp.Send
    'getHTML = xmlHttp.responseText
    'response.binarywrite xmlHttp.responseBody
    
    With CreateObject("ADODB.Stream")
        .Type = 1 'adTypeBinary
        .Open
        .Write xmlHttp.responseBody
        .SaveToFile filename
        .Close
    End With
    
    xmlHttp.abort()
    set xmlHttp = Nothing   
    
end function