I added python tags please use them in all future posts. (see BBCODE)
use requests, you will have to install the package, if you are unfamiliar with the install process, open a command window and type:
use requests, you will have to install the package, if you are unfamiliar with the install process, open a command window and type:
pip install requestscode:
import requests def download_stock_data(url, savefile): page = requests.get(url, allow_redirects=False) if page.status_code == 200: with open(savefile, 'wb') as f: f.write(page.content) else: print('Error downloading file') # ... more processing here ... def main(): download_stock_data(url='http://www.google.com/finance/historical?q=NASDAQ:GOOG&output=csv', savefile='goog.csv') if __name__ == '__main__': main()But .... Google responds with:
Quote:Google
Sorry...
We're sorry...
... but your computer or network may be sending automated queries. To protect our users, we can't process your request right now.
See Google Help for more information.