Wednesday, March 18, 2009

Chapter 5 -- Session 5.8

For completeness, Session 5.8 should look like this:


>>> u = urllib.request.urlopen('http://ichart.finance.yahoo.com/table.csv?s=TGT')
>>> u.readlines()[:10]
[b'Date,Open,High,Low,Close,Volume,Adj Close\n',
b'2009-03-17,29.44,30.45,29.13,30.45,10204800,30.45\n',
b'2009-03-16,30.30,30.44,28.75,28.83,11136300,28.83\n',
b'2009-03-13,28.69,30.01,28.18,29.97,16870100,29.97\n',
b'2009-03-12,26.89,28.69,26.60,28.49,12663900,28.49\n',
b'2009-03-11,27.25,27.85,26.76,26.90,15474000,26.90\n',
b'2009-03-10,25.75,27.66,25.46,27.21,13459800,27.21\n',
b'2009-03-09,25.40,26.35,25.13,25.37,11816500,25.37\n',
b'2009-03-06,26.63,26.79,25.00,25.65,12434600,25.65\n',
b'2009-03-05,26.88,27.82,26.04,26.31,13311700,26.31\n']

No comments:

Post a Comment