Download a file from the internet
In [1]:
import urllib
In [2]:
url_to_download = 'http://real-chart.finance.yahoo.com/table.csv?s=AAPL'
save_as_file = 'aapl.csv'
In [3]:
urllib.urlretrieve(url_to_download, save_as_file)
Out[3]:
Line by line explanations of how things work in Python
import urllib
url_to_download = 'http://real-chart.finance.yahoo.com/table.csv?s=AAPL'
save_as_file = 'aapl.csv'
urllib.urlretrieve(url_to_download, save_as_file)
('aapl.csv', <httplib.HTTPMessage instance at 0x000000000A0C9EC8>)