Home Free Scripts Financial Portal Data
Financial Portal Data E-mail

The script below will parses through MoneyCentral website and get the stock information base on the stock symbols you enter.

Information download are Last Price, 52 Weeks High, 52 Weeks Low,Volume, Average Volume 50 Days MA, 200 Days MA Volatility. You can also modify the script to suit to your own needs.

Sometimes you might want to get some financial data from a website that does not support URL parameter input such as Yahoo Finance, you can still do so eventhough it's a bit tricky. The method describe in this page will allow you to extract any data out from a standard HTML page.

For example, if you wanted to get the StockScouter Rating for INTC from Money Central website, and the rating can be found at the URL below:

http://moneycentral.msn.com/detail/stock_quote?Symbol=intc.

When you browse to the website you will see the rating as follow (rating as of Mar 08):

stockscouter

Before we start to come out with the script, we need to take a look of the HTML code of the web page above. To to this, just right click on any of the empty spaces on the web page above and select "View Source" in Internet Explorer or "View Page Source" in FireFox. This will bring up the HTML syntax for the web page in text editor.

If you look at the StockScouter above, it says "10 out of 10", so all StockScouter rating is something out of 10. Just do a search in the HTML source page, you will see the following:

stockscouter

So what you need to do now is to get the number before the string “out of 10”. Below is the script.

Set omIE = New SHDocVw.InternetExplorer

sPage = http://moneycentral.msn.com/detail/stock_quote?Symbol=aapl

omIE.Navigate BPage


sPage = omIE.Document.body.InnerHTML

sRating = InStr(1, sPage, “ out of 10”)
sRatngStart = sRating – 2
sRatingEnd = sRatingStart + 2
StockScouterRating = Mid$(sPage, sRatingStart, sRatingEnd – sRatingStart)
If Left(SockScouterRating, 1) <> “1” Then StockScouterRating = Right(StockScouterRating, 1)

The result you got is exactly ‘10’ as what you have seen on the web page above.

There isn’t any fix rule on what you need to search in the HTML page above, I just look for the closer string that near to the data I wanted to get.

I first look for the string “ out of 10” (note there is a space at the beginning), and then minus 2 from the position I got from the original result because I know the maximum StockScouter Rating can be is 2 digits.

Finally, I will check on the result I got, if the first digit is not equal to 1, then I know that the StockScouter Rating is a single digit value, hence I only take the second digit as the result.


Login or Register to download this Excel SpreadsheetRegister

Financial Portal Data

Again, you have to do some study on the HTML page see which string give you more flexibility and let you write your code more easily.

(Screenshots and script are as current as Mar 2008, publisher may change the webpage format from time to time.)