Posted by: Sourav | April 4, 2017

Web Scraping project,download historical stock data from yahoo finance using yahoo_finance module in Python 3,Python Teacher Sourav,Kolkata 09748184075


import yahoo_finance
import pandas as pd

symbol = yahoo_finance.Share(“GOOG”)
google_data = symbol.get_historical(“2014-01-01”, “2016-06-30”)
google_df = pd.DataFrame(google_data)

# Output data into CSV
google_df.to_csv(“/home/sourav/google_stock_data.csv”)

 

Source:http://stackoverflow.com/questions/12433076/download-history-stock-prices-automatically-from-yahoo-finance-in-python

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: