Forum Moderators: open

Message Too Old, No Replies

Using ASP to grab content

         

pcguru333

2:47 pm on Aug 30, 2002 (gmt 0)

10+ Year Member



Does any one know of a generic pure ASP script that can be used to grab any content from any page. ie stock info, weather, news headlines, etc. I don't need a specific one for each just a generic script that I can use to pull content once an hour.

Thanks

Hemsell

2:57 pm on Aug 30, 2002 (gmt 0)

10+ Year Member



you want to #include it or you want to spider it?

pull it where?

source or data between tags?

ukgimp

2:59 pm on Aug 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not sure about posting the URL so I have removed the link bit.

ultimateasp.com/tutorial/activex_openurl.asp

You may run into problems though, depending on what you intent to grab. If it is a news site or something that costs them money to produce I am guessing it wont be long before your IP is banned from the site.

Cheers

pcguru333

3:02 pm on Aug 30, 2002 (gmt 0)

10+ Year Member



Thanks ukgimp I will follow that URL

aspdaddy

3:03 pm on Aug 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Page scraping? not pure ASP as it uses a COM, (You can also do it client-side using I.E's object). I dont know any *pure* asp method.

<added>As long as you own the target site, you can use something like this:)</added>


function getPage( strPage )
set http_obj = server.CreateObject("Microsoft.XMLHTTP")
http_obj.open "GET", strPage , false
http_obj.send
getPage = http_obj.responseText
end function

You will also need to parse the actual data out with a function something like this:


function getData( byval strSource, byval strTagID, byval bDirection, byval intStart)

Xoc

5:35 pm on Aug 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For future reference, place links like that in your profile and reference it there.

The code shown hooks into the MSXML parser, which is a free download from the Microsoft web site. You will need to download and install it on the server for it to work.