Download source code from here.

Reading a remote web page ....

I needed a method of 'reading' a remote URL web page and then processing the text using ASP. This would provide a way of searching the remote page for a defined line of text, or possibly looking for links.

One way of doing this is to create an ActiveX DLL and call the object with ASP. This means going through registering the DLL on the server - so to be able to use this you must have direct access to the server itself.

Another method, which is quite simple, is to use pure ASP, and is described in another article on this site.

Once the DLL has been created and registered, the ASP side is trivial.

The source code is in VB6 and may be downloaded from here.

Method

I used Microsoft Internet Transfer Control 6.0 which provides the functionality to retrieve a remote file. I also included code to strip out the HTML from the page leaving pure text.

The source code that I have provided is set up to compile as an ActiveX DLL. However, you may wish to re-compile it as a .exe which will enable you to run the program displaying a form interface during testing.

To do this go to Projects : GetURL Properties. Change the Project Type to Standard EXE with the start up object set to frmDisplayURL. Running the code will start up in the form where you may enter example URLs.

If you change the Project back to ActiveX DLL don't forget to go to the Properties of clsURL and set the Instancing to MultiUse.

In ASP you need to do the following:

Dim objURL, txtURL
Set objURL = Server.CreateObject("geturl.clsURL")

Response.write "Time : " & Now() & "<br>"

objURL.URL = "http://www.webconcerns.co.uk/default.asp"
txtURL = objURL.StripHTML
Response.write (txtURL)
Set objURL = Nothing