urllib error in Sage running on a Mac
I have used urllib in Sage for a while now (on Mac OS Yosemite). However, recently I've been getting an error: [Errno url error] unknown url type: 'https'
The code I'm using is getting exchange rates from Yahoo.
import urllib
def getRate(sym):
url = 'http://finance.yahoo.com/d/quotes.csv?s=%s&f=%s' % (sym, 'l1c1va2xj1b4j4dyekjm3m4rr5p5p6s7')
values = urllib.urlopen(url).read().strip().strip('"').split(',')
return float(str(values[0]))
sym="EUR=X"
getRate(sym)
add a comment