Here's a different approach, this is my preference. It uses something called Yahoo Query Language (YQL) which allows you to return data from a wide range of sources (html, XML, Data Tables, JSON, etc) in an XML format using a SQL like syntax. It's a brilliant resource for things like web scraping and getting data in general since it also allows the use of XPath in the Where clause for use on HTML, it also allows you to query many sites in a single call which can be handy.
Anyways, back on topic
You can use YQL to access on-line datatables that have set up, in the example below I am using one of the Yahoo Finance tables called historicaldata, the syntax for the query would be:
You can try it out here to see what it returns:
http://developer.yahoo.com/yql/conso...72012-04-11%27
We can then take the url at the bottom and adapt it to our needs, so something like:
It can then be called with something like:
I've only scratched the surface with what you can do with YQL, but if you are interested in scraping web data, it's well worth looking into.
Bookmarks