Member-only story

Get Highest Yield Dividend Stocks S&P 500 using Python and YFinance — Easy

The Scraper Guy
3 min readOct 11, 2024

--

Start investing in dividend stocks with a few lines of code

Introduction

Dividend paying stocks offer investors another stream of income, to either re-invest or cash out. A portfolio of dividend only stocks is a legitimate strategy used by investors all over the world.

Today using Python and Yfinance we will get the stocks in the S&P 500 paying dividends either on or after todays date.

Before we begin we have to understand a few definitions.

Firstly, the “ex dividend date” is the first day where a stock trades without its dividend value. In essence if you buy the stock before this day, you are entitled to the next dividend payment. Any stock purchased on or after this day will receive a dividend payment.

In addition, the dividend yield can be defined as how much the company actually pays out in dividends each year relative to its stock price. We will use this metric as our base for calculating the highest yield dividend stocks.

Formula for dividend yield-

--

--

The Scraper Guy
The Scraper Guy

Written by The Scraper Guy

Teaching You How to Scrape Using Python LinkTree - https://linktr.ee/scrapingguy

No responses yet