Click here to Skip to main content
13,596,105 members
Click here to Skip to main content
Add your own
alternative version


6 bookmarked
Posted 22 Jul 2001
Licenced CPOL

Retrieve a HTML page from within your (ASP-)Scripts without any components

, 28 Aug 2001
Rate this:
Please Sign up or sign in to vote.
Tiny little Perl library to retrieve an arbitrary URL as a string.
<!-- Download Links --> <!-- Add the rest of your HTML here -->


Today I needed to retrieve a HTML document not local to my website from within an ASP application and display its content. I've written some time ago another ActiveX component, but I wanted it this time without any components.

Therefore I used PerlScript that comes with ActivePerl to write two small functions in Perl and use them from within normal (VBScript-)ASP.

Just two functions

The functions are called GetUrlContent(url) and GetUrlBody(url). Both functions return the content of an arbitrary URL as a string. The first function returns the whole content, whereas the second function returns only what is inside the


The usage of the functions is very easy, just call them with the URL you wisth to retrieve. E.g.

Response.Write GetUrlContent("")


Response.Write GetUrlBody("")


Beside the latest version of ActiveState's ActivePerl, you need to download and install the libwww-perl from


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Uwe Keim
Chief Technology Officer Zeta Producer Desktop CMS
Germany Germany
Uwe does programming since 1989 with experiences in Assembler, C++, MFC and lots of web- and database stuff and now uses ASP.NET and C# extensively, too. He has also teached programming to students at the local university.

In his free time, he does climbing, running and mountain biking. Recently he became a father of a cute boy.

Some cool, free software from us:

German Developer Community  
Free Test Management Software - Intuitive, competitive, Test Plans. Download now!  
Homepage erstellen - Intuitive, very easy to use. Download now!  
Send large Files online for free by Email

You may also be interested in...


Comments and Discussions

QuestionLWP? Pin
Anonymous28-Apr-04 17:15
sussAnonymous28-Apr-04 17:15 
QuestionEasier way? Pin
Anonymous30-Jul-01 4:42
memberAnonymous30-Jul-01 4:42 
AnswerRe: Easier way? Pin
Anonymous6-Mar-02 19:35
memberAnonymous6-Mar-02 19:35 

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.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04-2016 | 2.8.180621.3 | Last Updated 29 Aug 2001
Article Copyright 2001 by Uwe Keim
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid