Don't like ads? PRO users don't see any ads ;-)
Guest

getHTML

By: blonkm on Apr 17th, 2012  |  syntax: ASP  |  size: 0.67 KB  |  hits: 30  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Function getHTML (strUrl)
  2.         Dim xmlHttp
  3.         Dim parts
  4.         Dim resource
  5.         Dim querystring
  6.  
  7.         queryString = ""
  8.         resource = strUrl
  9.         if instr(strUrl, "?")>0 then
  10.                 parts = split(strUrl, "?")
  11.                 resource = parts(0)
  12.                 queryString = parts(1)
  13.         end if
  14.  
  15.     Set xmlHttp = Server.Createobject("MSXML2.ServerXMLHTTP.3.0")
  16.     xmlHttp.Open "GET", resource, False
  17.     xmlHttp.setRequestHeader "Cache-Control", "no-cache"
  18.     xmlHttp.setRequestHeader "User-Agent", "asp httprequest"
  19.     xmlHttp.setRequestHeader "content-type", "application/x-www-form-urlencoded"
  20.  
  21.     xmlHttp.Send (queryString)
  22.  
  23.     getHTML = xmlHttp.responseText
  24.     xmlHttp.abort()
  25.     set xmlHttp = Nothing
  26. End Function