Skip to main content

Yahoo statistics webscraper

Project description


Python version Travis-CI build status CodeFactor Codecov PyPI license PyPi version PyPi status PyPI - Downloads Docs Build Status Star this repo image

Webscrape stock statistic data from:

  • yahoo finance,
  • reuters,
  • morningstar,
  • zacks.

Quick start

Try on colab:

Python version

from yahoostats.evaluator import combine_stats
stocklist = ['GOOGL', 'TSLA', 'AMD']

Explanation for webscraped data:

tr_score                                 6/10   Tipranks total score
tr_AnalystRatings                  Strong Buy
tr_BloggerOpinions                    Bullish
tr_Hedge FundActivity               Decreased
tr_InsiderActivity                Sold Shares
tr_TipRanksInvestors                  Neutral
tr_NewsSentiment                      Bullish
tr_Technicals                        Negative
tr_Fundamentals                        17.83%
tr_target_pr                         1482.030    Tipranks target price after 12 months
tr_change                     (7.06% Upside)    Tipranks
tr_next_ex_dividend_date                 None    Tipranks Next Ex-dividend Date
tr_dividend_amount                       None    Tipranks Next dividend amount
ex_date1                          Nov 9, 2020    Tipranks ex-dividend date history
ex_date2                          Aug 7, 2020    Tipranks ex-dividend date history 
ex_date3                          May 7, 2020    Tipranks ex-dividend date history
ex_date4                          Feb 7, 2020    Tipranks ex-dividend date history
ex_date5                          Nov 7, 2019    Tipranks ex-dividend date history
PEG Ratio (5 yr expected) 1              1.94    Yahoo Finance PEG Ratio
sa_rating                             3.20513    Seeking alpha rating 1(bearish) ÷ 5 bullish
sa_target_price                       1550.73    Seeking alpha target price
yf_price_now                          1384.34    Yahoo Finance price now
yf_price_target                       1515.73    Yahoo Finance target price
yf_ratingvalue                            1.8    Yahoo Finance recomendation score
yf_ratingstring                           buy    Yahoo Finance recomendation
yf_profit                             1.09491    Yahoo finance profit (target/current price)
yf_current_ratio                        3.658    Yahoo Finance Current ratio
yf_return_assets                      0.08712    Yahoo Finance Return on assets
yf_return_equity                      0.17835    Yahoo Finance Return on equity
yf_beta                                1.0649    Yahoo Finance Beta factor
ms_stars                              r_star3    Morningstar star rating [0-5]stars
zacks_rate                             3-Hold recomentations
r_beta                                   1.06    Reuters Beta factor
r_eps_gr3                               20.82    Reuters EPS_Grow 3 years
r_eps_gr5                               19.92    Reuters EPS Grow 5y
r_div_gr3                                  --    Reuters Dividents grow 3y
r_roi_ttm                               15.56    Reuters Return on investment TTM
r_roi_5                                 15.02    Reuters Return on investment 5years
r_current_ratio                          3.37    Reuters Current ratio
r_mar_cap                          919,046.30    Reuters Market cap
r_net_income                        35,813.79    Reuters Net income
r_net_debt                        -115,121.00    Reuters Net debt
r_div_yield                                --    Reuters dividents yeld
r_div_yield5                               --    Reuters dividents yeld 5 years
r_rev_employee                   1,401,837.00    Reuters Revenue/Employee
r_eps                                   51.27    Reuters Deluted EPS
eps_-4q                                 12.76    Estimated EPS 2020Q1- Wall st consensus 
eps_-3q                                 10.66    Estimated EPS 2020Q2
eps_-2q                                  7.95    Estimated EPS 2020Q3
eps_-1q                                 11.28    Estimated EPS 2020Q4
eps_cur                                 15.74    Estimated EPS 2021Q1
eps_+1q                                 13.51    Estimated EPS 2020Q2
eps_+2q                                 14.03    Estimated EPS 2020Q3
eps_+3q                                 16.41    Estimated EPS 2020Q4

Install system requirements

On Windows:

  • Firefox with geckodriver in PATH
  • Chrome with chrome-driver in PATH

On Linux:

For Chrome -please check version compatability chrome-driver

sudo apt-get update
sudo apt-get install chromium chromium-driver

For Firefox -

sudo apt-get update
sudo apt-get install wget libgtk-3-0 libdbus-glib-1-2 libxt6

wget -O /tmp/firefox.tar.bz2$FIREFOX_VERSION/linux-x86_64/en-US/firefox-$FIREFOX_VERSION.tar.bz2
rm -rf /opt/firefox 
tar -C /opt -xvjf /tmp/firefox.tar.bz2 
rm /tmp/firefox.tar.bz2 
mv /opt/firefox /opt/firefox-$FIREFOX_VERSION 
sudo ln -fs /opt/firefox-$FIREFOX_VERSION/firefox /usr/bin/firefox

tar -xvzf geckodriver-v$GECKO_VERSION-linux64.tar.gz   
sudo cp geckodriver /usr/local/bin/
sudo chmod a+x /usr/local/bin/geckodriver

Install python requirements on venv

On Windows:

python -m venv env
pip install -r requirements.txt
pip install yahoostats

On Linux:

alias python=python3
python -m venv env
source env/bin/activate
pip install -r requirements.txt
pip install yahoostats

Python Requirements

  • pandas==1.0.3
  • requests>=2.21.0
  • beautifulsoup4==4.6.3
  • urllib3==1.25.9
  • selenium==3.141.0


This project is licensed under the MIT License - see the LICENSE.txt



If you want to send me a tip:

  • Buy me a coffee
  • BTC address = 1GfRewxWtovg7gHYiKvGyaxxEhzdN2CMgC
  • LTC address = LS9Jcek1mCrvbpsnbyaCHHtn6iqpM6ef4a

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yahoostats-0.0.5.tar.gz (30.9 kB view hashes)

Uploaded Source

Built Distribution

yahoostats-0.0.5-py3-none-any.whl (39.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page