Click here to Skip to main content
15,891,136 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 326.6K   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

 
GeneralMy vote of 1 Pin
Raul Butuc9-Jun-19 4:54
Raul Butuc9-Jun-19 4:54 
GeneralCode in ASP.NET Pin
Ammar Arwany19-Sep-07 22:11
Ammar Arwany19-Sep-07 22:11 
QuestionGetSourceCode.asp is giving error Pin
Jaks M23-Dec-06 0:18
Jaks M23-Dec-06 0:18 
GeneralPls Help me Emergently Pin
AlexDa13-Mar-06 0:20
AlexDa13-Mar-06 0:20 
GeneralWindow to fill the screen Pin
Anonymous25-Jan-05 0:59
Anonymous25-Jan-05 0:59 
GeneralEasy Source Code View Pin
RajaRavipati31-Aug-04 23:57
RajaRavipati31-Aug-04 23:57 
GeneralRe: Easy Source Code View Pin
richardhennessy10-Feb-05 4:53
richardhennessy10-Feb-05 4:53 
GeneralEasy Source Code View Pin
RajaRavipati31-Aug-04 23:48
RajaRavipati31-Aug-04 23:48 
GeneralWorking perfectly for one url. I need to do it for multiple urls. Pin
Member 138812616-May-03 4:39
Member 138812616-May-03 4:39 
GeneralWorking perfectly for one url. I need to do it for multiple urls. Pin
Anonymous16-May-03 4:39
Anonymous16-May-03 4:39 
GeneralWas lookin for something like this last week Pin
Ivel13-Mar-03 11:47
Ivel13-Mar-03 11:47 
Generalview-source protocol Pin
29-Oct-02 18:03
suss29-Oct-02 18:03 
GeneralGetSourceCode.asp is giving error Pin
vikaskumar101@email.com29-Oct-02 17:02
vikaskumar101@email.com29-Oct-02 17:02 
Generalthelp me please Pin
Anonymous10-Jul-02 22:09
Anonymous10-Jul-02 22:09 
GeneralProblem with this method. Pin
9-Jun-02 14:22
suss9-Jun-02 14:22 
GeneralThis always works. Pin
Mike Whitenton7-Feb-02 8:48
Mike Whitenton7-Feb-02 8:48 
GeneralRe: This always works. Pin
Philip Patrick18-Mar-02 8:22
professionalPhilip Patrick18-Mar-02 8:22 
GeneralRe: This always works. Pin
6-May-02 6:39
suss6-May-02 6:39 
GeneralRe: This always works. Pin
Smashfist3-Nov-04 10:28
sussSmashfist3-Nov-04 10:28 
GeneralBin to AscII Pin
29-Jan-02 11:44
suss29-Jan-02 11:44 
GeneralViewing Source Pin
Jason Hooper29-Jan-02 10:58
Jason Hooper29-Jan-02 10:58 
GeneralGreat Com Great Tip Pin
29-Jan-02 10:14
suss29-Jan-02 10:14 
GeneralProblem using "GetSourceCode.asp" Pin
14-Jan-02 17:59
suss14-Jan-02 17:59 
GeneralRe: Problem using "GetSourceCode.asp" Pin
11-Feb-02 22:20
suss11-Feb-02 22:20 
QuestionProblem using GetHTML after a while? Pin
21-Oct-01 1:04
suss21-Oct-01 1:04 

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.