Shopping Cart Hosting & eCommerce Merchant Account Integration services

 

Request a Free Quote

Contact Us - Call 1-877-627-2492    


 
Earth Skater Custom eCommerce [Home]
  Authorize.net Certified Developer PayPal Certified Integration CyberSource Certified Developer
      You are here:   Home · Dev Zone · XMLHTTP ASP Code Example      
 
eCommerce Hosting
Affiliate Software
Website Analytics
Merchant Accounts
Merchant Integration

Internet Marketing
Content Management
Custom Development
Custom Web Design

Why Earth Skater
Our Clients
Our Partners
     

E-Commerce Blog

eCommerce 101 & Merchant processing
4 September 2008

 
 

Author: Staff
EarthSkater.net
This is a small example on using the Microsoft XMLHTTP Control

If you are reading this page then I shall assume that you already know a little bit about ASP and running ASP scripts.

Here is the ASP code to pull yahoo's html and output it on your page.  There are many potential uses for this code including screen scraping (pulling sections of another web site onto yours), and more.


<%

dim objXMLHTTP
dim URL

URL = "http://www.yahoo.com"   'the url that you want to pull html from

Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")   'create the xmlhttp object
objXMLHTTP.Open "GET", URL, false   'use the open command to get the url
objXMLHTTP.Send

  'TO GET HEADERS
  'response.write objXMLHTTP.getAllResponseHeaders

Response.Write "<hr>"
Response.Write "<h4>HTML Code for&nbsp"&URL&"</h4>"
Response.Write "<textarea rows=30 cols=120>"
Response.Write objXMLHTTP.responseText    'output the html that was pulled from the page
Response.Write "</textarea>"

Set objXMLHTTP = Nothing

%>
 

 


Program Output:


HTML Code for http://www.yahoo.com