Introduction
LabVIEW is not a traditional tool for financial management, but that doesn't mean you can't use it to check on your investments. This VI demonstrates how to use Yahoo.com's stock checker in an automated loop to keep track of your stock prices. It can be extrapolated to other instances where reading html source is necessary in LabVIEW.
Steps to Complete
Download Stock Checker.vi.
Run VI, after entering tickers in the left hand control.
Every three seconds, the prices update.
Additional Notes
Yahoo updates slower than every three seconds, so you may want to turn down the update rate for processor considerations.
Example is written in LabVIEW 2009. If Yahoo's formatting changes, this may not work down the road.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Hi Verne_D
Great share. I need to ask you as to why the field returns other text as opposed to the price for a given ticker ?
Probably they changed the html string... so you'll need to correct the string search!
The best way to find out the strings you should search for is using a browser. Do the yahoo querry there. e.g.:
"http://finance.yahoo.com/q?s=BTC-USD"
then view the HTML of the page and search the Value you want. Then you can search the surrounding strings in labview.:
e.g.: in Firefox you see the line which belongs to the value
then you can adjust your string search to search the strings surrounding your wanted value:
and then you get the values:
If they change their page constantly this might not be a good way to get the values cause you need to change your string search accordingly.
Anyway, I'll give it a try now and run it for some time 🙂
Thanks Verne_D for the basic vi and idea!! 🙂