I have, at various times, wanted to download the data from financial websites for prices, calculation or tracking or some other purposes. I distinctly remember when I wanted to download the Soyabean prices and quotes from NBOT (which were not publicly downloadable and intra-day charts/data is still not available), and ended up creating a resource hogging monstrous excel which had more downsides than any use.
Peter Ponzo's method of downloading the data from Yahoo Finance gave a very good method of how the information could be downloaded from sites, for us to get the data from the static but non-download friendly sites like Reuters, we needed to utilize Ponzo's URL concatenation as well as use the web query. In other words, dynamic web query.
Step 1: Open the web page that you want to download the data from and copy the URL (Here I am downloading the Balance Sheet of IBM)

Step 2: Open the Web Query browser in Excel and the use the above URL



Step 5: The file will be saved as an IQY file. Open the file in a notepad, it should look like this:


When done, Save and close the file.

Step 8: Select the query and Import the data


Enter the Reuters Symbol for the stock, and the specific data will be downloaded on to the system.
See a sample sheet here
But almost all the times, have only found frustration in not being able to download the data. Even if the stock data could be downloaded, they were not in the format that will help easy calculation with help of MS Excel. It was in this search that I came across Gummy Stuff and Mr. Ponzo's remarkable macros that helped us download the data from Yahoo Finance. But the only problem was that it could only download the EOD stock prices or market related information. Downloading the fundamental data from the sites like Reuters and Yahoo Finance looked near impossible. Then came web query.
Peter Ponzo's method of downloading the data from Yahoo Finance gave a very good method of how the information could be downloaded from sites, for us to get the data from the static but non-download friendly sites like Reuters, we needed to utilize Ponzo's URL concatenation as well as use the web query. In other words, dynamic web query.
Even though there were some good material available on creating dynamic web queries, the pursuit always ended in distress. So, after long last when I finally made it (yeah!) I decided to write a post on how I did it for everybody who would like to know more about how they can build a dynamic web query to download data and information from sites like Yahoo Finance, Bloomberg, Reuters and Marketwatch. Though I have not tested this against other sites, it should be possible.
Step 1: Open the web page that you want to download the data from and copy the URL (Here I am downloading the Balance Sheet of IBM)
Step 2: Open the Web Query browser in Excel and the use the above URL
Step 3: Import the data from the website, ensure all the data is downloaded. (It could be possible in some cases to download only the relevant table, but with sites like Reuters it is not possible)
Step 4: When the data is loaded, before you click import, save the Web Query
Step 5: The file will be saved as an IQY file. Open the file in a notepad, it should look like this:
Step 6: Replace the parameter with a distinct phrase enclose in square brackets. Here the distinctive parameters is IBM.
When done, Save and close the file.
Step 7: Open a New or Excel file where you want the data and Import the Query
Step 8: Select the query and Import the data
Step 9: The system should ask you for the Parameter to be entered by displaying the phrase you had quoted
Enter the Reuters Symbol for the stock, and the specific data will be downloaded on to the system.
The URLs are similar for most of the downloadable content, so by playing with the URLs and the parameters defined, users should be able to configure most of their requirements for download. For example Yahoo Finance's fundamental page has the following URL: http://finance.yahoo.com/q/ks?s=IBM, here the distinct parameter being IBM; replace "IBM" and you will have your query ready.
See a sample sheet here
Comments
Post a Comment