The url of downloading historical prices of Yahoo Finance has changed #4997

Merged
merged 2 commits into from Feb 12, 2017
Jump to file
+3 −5
Split
@@ -338,12 +338,10 @@ def fetch_historical_yahoo(ticker, date1, date2, cachename=None,
else:
g = 'd'
- urlFmt = ('http://ichart.yahoo.com/table.csv?a=%d&b=%d&' +
- 'c=%d&d=%d&e=%d&f=%d&s=%s&y=0&g=%s&ignore=.csv')
-
- url = urlFmt % (d1[0], d1[1], d1[2],
- d2[0], d2[1], d2[2], ticker, g)
+ urlFmt = ('http://real-chart.finance.yahoo.com/table.csv?' +
+ '&s=%s&d=%d&e=%d&f=%d&g=%s&a=%d&b=%d&c=%d&ignore=.csv')
+ url = urlFmt % (ticker, d2[0], d2[1], d2[2], g, d1[0], d1[1], d1[2])
# Cache the finance data if cachename is supplied, or there is a writable
# cache directory.
if cachename is None and cachedir is not None: