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 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
PEG Ratio (5 yr expected) 1              1.94    Yahoo Finance PEG Ratio
yf_pr_now                             1384.34    Yahoo Finance price now
yf_pr_trg                             1515.73    Yahoo Finance target price
yf_rv                                     1.8    Yahoo Finance recomendation score
yf_rs                                     buy    Yahoo Finance recomendation
yf_prof                               1.09491    Yahoo finance profit (target/current price)
yf_cur_ratio                            3.658    Yahoo Finance Current ratio
yf_ret_assets                         0.08712    Yahoo Finance Return on assets
yf_ret_equity                         0.17835    Yahoo Finance Return on equity
yf_beta                                1.0649    Yahoo Finance Beta factor
ms                                    r_star3    Morningstar star rating [0-5]stars
zacks                                  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

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 
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.24.3
  • 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.

Files for yahoostats, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size yahoostats-0.0.4-py3-none-any.whl (12.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size yahoostats-0.0.4.tar.gz (22.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page