Created
November 18, 2016 14:22
-
-
Save AlexJoz/3c5b2e7b68b57d7fc2823ea4e7345773 to your computer and use it in GitHub Desktop.
Download file from http link with python2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
#put your link here =) | |
url = "http://ichart.finance.yahoo.com/table.csv?s=^GSPC&c=2016" | |
file_name = "table.csv" #can parse fname from url, ofcoz. | |
u = urllib2.urlopen(url) | |
gspc = u.read() | |
with open(file_name, 'wb') as f: | |
f.write(gspc) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment