9:30 am Wednesday, August 20, 2008


  Navigation
  Help?
Contact Aaron for all inquiries.
 

  News

ASP Inline Calendar 3.9 Beta 1
ASP Games
ASP Inline Corporate Calendar 3.8 BETA 1 Demo
Calendar Updates
 

A Better World By Design
 
 
AaronOutpost : ASP / Tutorials / Web Fetching XMLHTTP

Aaron's Web Fetching XMLHTTP
By: Aaron B. Copyright AaronOutpost.com

This is a XMLHTTP Function to get the HTML coding a specified webpage and then display it on your site. So, if the page you request have images on it and you don't have the same images in a directory on your site they will not be listed. If you want, you can save the data into a database and process it and strip other data if you want to extract what you want.

BE AWARE!!! You need to make sure you have permission to take information from another site!
<%
'----------------------------------------------------------------------------
'This Function by AaronOutpost.com to fetch a URL and display it
'----------------------------------------------------------------------------


Function fetch_url (strURL)

On Error Resume Next

set XMLHTTP_AARON = Server.CreateObject ("Microsoft.XMLHTTP")
XMLHTTP_AARON.Open "GET", strURL ,False,"",""
XMLHTTP_AARON.Send

If Err.Number = 0 Then
If XMLHTTP_AARON.status = 200 Then
fetch_url = XMLHTTP_AARON.responsetext
Else
fetch_url = "Bad URL"
End If
Else
fetch_url = Err.Description
End If

set XMLHTTP_AARON = nothing

end Function


' call the Function to write url results
response.write fetch_url ("http://www.aaronoutpost.com")

%> 

 


AaronOutpost : ASP / Tutorials / Web Fetching XMLHTTP

Aaron Outpost West Virginia, USA A Mark of _-Squire-_ Creations Inc.  CopyrightŠ 2005 All Rights Reserved