VBScript: Get Source Code of a Web Page

This method will work only in Internet Explorer. Also, this is only the way to get cross-domain source code. However, you can use this code externally also.

<script type="text/vbscript">
Dim url, src, http
Set http = ObjCreate("winhttp.winhttprequest.5.1")
src = http.Responsetext

If you want to use this code externally, then you should save it as name.vbs. But you should remove the last line. Instead, you can try alternate ways like msgbox, filewrite, etc to show the output. For example, replace last line by this:


This will show the source code directly in a messagebox.

No comments:

Post a Comment

Thank you for commenting. Please keep visiting.