Simple Python Script to retrieve all stocks data from Google Finance Screener (Part 2)

Upgraded version from previous “Simple Python Script to retrieve all stocks data from Google Finance Screener“. The new version allows options to select the various stocks exchange including all US exchange and expand on the financial metrics present.

To run the script, you can simply run the following commands.

from google_screener_data_extract import GoogleStockDataExtract

hh = GoogleStockDataExtract()
hh.target_exchange = 'NASDAQ' #SGX, NYSE, NYSEMKT
hh.retrieve_all_stock_data()
hh.result_google_ext_df.to_csv(r'c:\data\temp.csv', index =False) #save filename

The new script allows easy installation via pip. To install:
pip install google_screener_data_extract

The script is also available in GitHub.

Advertisements

6 comments

  1. these packge installation results in syntax errors because “print” calls are being used without parenthesis in this and pattern-2.6 package

    1. Hi buy sell, these packages are run on Python 2.x. If you use python 3, there will be syntax error particularly with the print statement. Hope that helps 🙂

    1. Hi QB, this is mainly for SGX but you can do slight tweaking for other exchanges.

      Alternatively, you can also refer to below post “Simple Python Script to retrieve all stocks data from Google Finance Screener (Part 2)” https://goo.gl/deU5CS which enables data scraping for different exchanges found in Google screener.

      Hope that helps.

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