Discussion Locked

Retrieving content from webpages

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Is it possible, using asp, XML, java in an Applet or java/VB script running in a browser( WITHOUT installing dll's etc to the server) to load a webpage from a server (other that the one the code runs on) and have access to the data. As for example, loading weather data from a page that lists cities and temperatures and extracting relevent data for a city. I know I can do it from a VB/Java application or with a COM object but can it be done without registering anything on the server?

3 replies

by jay eckles

It sounds like you're talking about someone "screenscraping" a web page with totally client-side (i.e. in the browser) programming. If that's the case, then really all you have to work with is Javascript or VBScript or a Java applet. ASP can't be run on the client - it has to be run on a web server.

If you know the format of the HTML of the page you want to draw information from, it may be possible to use a Java applet to fetch the page, parse the HTML, and display the information in whatever format you want. It might even be possible to do this in Javascript by opening the page in an off-screen window and then referencing data through some DOM object like childwin.document.all['tagname'].innerHTML or something like that...making it cross-browser compatible would be a pretty good challenge.

In either of these methods, if the format of the data on the web page changes, you'll have to change your code accordingly.

The short answer to your question is, "yes, it's possible". However, I would strongly suggest you look at some server side programming; it will save you a TON of work.

Good luck.

Jay Eckles
www.jayeckles.com

This discussion is closed to new replies.