- Bohack - https://www.bohack.com -

Simple VBScript to Display a Web Page

I was currently working on a VBScript to pull some information from a web page. So decided to build a function for it, so that it can be reused over and over again in other scripts. It uses the XMLHTTP library to query a URL and return the elements, I just ask for the responsetext and return it.

Function GetHTML (url)
dim http
set http = createobject("msxml2.xmlhttp.3.0")
http.open "get", url, False

GetHTML = http.responsetext

set http = Nothing
End Function

WScript.echo GetHTML ("http://www.bohack.com")