FREE tutorial,solution,RSS Feeds on Operating Systems, Programming, Web Development, Applications, Databases, Networking, Hardware, Security, SEO Free Expertsforge Membership
Join us as Moderator
Submit Article to Expertsforge.com Submit Article My Expertsforge
 
RSS Feeds, Help Help RSS Feeds
bannertop
 

ASP Tutorial: Grab a web page with ASP

jawahar
5/27/2005 6:13:49 AM, Views: 2758
The following code shows how to grab a web page using the infamous ASP.

This function is used to grab an HTML page using Microsoft's XMLHTTP component , using this component you can grab any page off the internet . Here is the code for this example

<%
Function GrabPage(strURL)
   Dim objXML
   Set objXML = Server.CreateObject("Microsoft.XMLHTTP")
   objXML.Open "GET" , strURL , False ,"",""
   objXML.Send
   If Err.Number = 0 Then
      If objXML.Status = 200 then
         GrabPage = objXML.ResponseText
      Else
         GrabPage = "Incorrect URL"
      End if
   Else
      GrabPage = Err.Description
   End If
   Set objXML = Nothing
End Function
%>


And you call the GrabPage Function like this

<%= GrabPage("http://www.expertsforge.com")

Next Steps:
Add this Tutorial to:
Blink Blink del.icio.ous Del.icio.us Digg Digg
Fark Fark Furl Furl Google Google
Reddit Reddit Simpy Simpy Spurl Spurl
Technorati Technorati Windows Live Win Live Yahoo Yahoo
Rate Me!
Avg Visitor Rating: Average Visitor Rating is 2 out of 5
Number of Ratings : 1 Votes
Rate:
Send Private MessageSend Message
Signup / Login To View the Solution or Provide Comments
Post Comment/Solution
Comment:*
        (Link Rules) 
  Use : [bold] for <b>; [/bold] for </b>; [italic] for <i>; [/italic] for </i>; [code] & [/code] for code
 
Categories
Options
ASP RSS Feed
Most Popular Tutorial
Most Popular Solution
Top Rated
Top Contributors
Yearly
Overall
 
1. jawahar (200)
bnrtop