Click here to Skip to main content
16,015,969 members
Articles / Programming Languages / ASP
Article

Get HTML Source of any URL

Rate me:
Please Sign up or sign in to vote.
3.22/5 (9 votes)
3 Apr 2001 330.4K   4.3K   38   40
This articles shows how to get HTML source of a URL, even if the URL uses tricks to prevent you from viewing the source

Introduction

Some web sites don't let you view the source code by disabling the right mouse key. Some other web sites don't display top level menus, so you can not view source using "View + Source" menu option.

How to display the code

So, how do you display the code, if a site uses one of the above method to prevent you from seeing the source code. The sample ASP application uses Microsoft XMLHttp object to get a URL's source code. It just makes a synchronous HTTP Get request and displays the response in a textarea.

Installation Notes

Copy the ASP file to the root directory (typically, inetpub/wwwroot). You must run either a Personal Web Server on your machine or have access to a web server that runs IIS.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
India India
Dhandapani Ammasai(Dan in short) is a software delivery manager at a top tier IT company in India.

Comments and Discussions

 
AnswerRe: Problem using GetHTML after a while? Pin
agcao17-Feb-08 9:14
agcao17-Feb-08 9:14 
QuestionHow do I check to see if all the html have been loaded in ? Pin
1-Jul-01 9:57
suss1-Jul-01 9:57 
AnswerRe: How do I check to see if all the html have been loaded in ? Pin
27-Jul-01 4:08
suss27-Jul-01 4:08 
GeneralRe: How do I check to see if all the html have been loaded in ? Pin
21-Oct-01 0:57
suss21-Oct-01 0:57 
GeneralThanks Pin
Dhandapani Ammasai11-May-01 15:24
Dhandapani Ammasai11-May-01 15:24 
GeneralMSXML Parser Pin
Andre Milton9-Apr-01 7:30
Andre Milton9-Apr-01 7:30 
GeneralAnother approach Pin
tim tabor2-Apr-01 5:07
tim tabor2-Apr-01 5:07 
GeneralRe: Another approach Pin
4-Apr-01 3:39
suss4-Apr-01 3:39 
Now, that's a cool function!

I had no idea you could do this. See, you learn something new every day.
GeneralRe: Another approach Pin
15-Apr-01 16:53
suss15-Apr-01 16:53 
GeneralRe: Another approach Pin
Member 12704615-Dec-02 17:40
Member 12704615-Dec-02 17:40 
GeneralNot working... Pin
Ammar28-Mar-01 18:32
Ammar28-Mar-01 18:32 
GeneralRe: Not working... Pin
2-Apr-01 17:44
suss2-Apr-01 17:44 
GeneralAnswer: Not working... Pin
25-Feb-02 1:49
suss25-Feb-02 1:49 
GeneralYou CAN do this in IE Pin
Uwe Keim27-Mar-01 19:14
sitebuilderUwe Keim27-Mar-01 19:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.