From: <jlb...@ne...> - 2002-12-30 18:22:13
|
There are two *.py programs at Python's Vaults_of_Parnassus site, (http://www.vex.net/parnassus/) both which get stock quotes from the Yahoo.com web site, 'Quoter' and 'Quote'. My question is, does anyone have any information and/or documentation resources about the *.csv (comma seperated string) protocol as used by Yahoo.com as indicated in the URLs below? #Quoter, where 'stockstr' looks something like "SUNW+INTC+ORCL". reply = urllib.urlopen( 'http://finance.yahoo.com/d/quotes.csv?s=' + stockstr + '&f=l1&e=.csv').read() This apparently returns a CSV formatted string which is decoded back into the MS Excel spreadsheet. I only get win32com errors, and thus cannot get this program to work. #Quote, where 'symbol' is a single stock string like "FDGRX" reply = urllib.urlopen('http://quote.yahoo.com/d/quotes.csv?s=%s&f=sl1d1t1c1ohgvj1pp2owern&e=.csv' %(symbol)) (This apparently redirects to the 'http://finance.yahoo...' page similar to Quoter above, but it works) This returns a string like, '"FDGRX",35.55,"12/27/2002","5:59pm",-0.69,N/A,N/A,N/A,N/A,N/A,36.24,"-1.90%",N/A,"N/A - N/A",N/A,N/A,"FIDELTY GROWTH"'. This is then parsed into its component parts: Symbol, Value, Date, Time, Change, and etc. for a total of 17 pieces of information for each stock. Apparently this is all requested in the '&f=sl1d1t1c1ohgvj1pp2owern' part of the URL above. (?) My goal is to fire one query with a concantenated list of the stocks, (apparently like Quoter does above), and then parse and decode the returned comma delimited string into its constituent parts. Any help is appreciated, and I promise to put the finished product, including documentation, back to the web. Thanks JohnB -- If your not #1, you're mediocre """ o o \^/ --""--^--""-- Whenever I feel blue, I start breathing again. __________________________________________________________________ The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/ |