How To Get a Dividend EACH Month Using Python [Dividend Scraper]

Поделиться
HTML-код
  • Опубликовано: 14 июн 2024
  • Hi everyone,
    in this video we are going to scrape dividends to get an overview of when stocks are paying dividends in each month. This is getting the Ex-Dividend Date. In the US the payment date is usually roughly 1 month after the ex date so if you wanna have the payment date you would need to add up a month to that.
    Feel free to use that on the S&P500 (working as well) or your home index. Let me know your thoughts in the comments below :-)
    If you like my content please support my channel by subscribing, liking and comment on my videos. It's for free :-) Thanks a lot in advance.
    Disclaimer: This is no investment advice. Video is for educational and entertainment purposes only.
    #Python #DividendInvesting #Finance

Комментарии • 51

  • @andrewfrost8866
    @andrewfrost8866 5 месяцев назад +1

    An excellent, well-presented, informative video; thank you for taking the time to create and share this!

    • @Algovibes
      @Algovibes  5 месяцев назад

      Thank you very much Andrew, appreciate your comment! Be invited to check out my other videos.

  • @mschuer100
    @mschuer100 3 года назад +2

    Great video.. very useful code for anyone looking to invest in dividend paying stocks. Thanks for putting
    together another awesome and practical tutorial.

    • @Algovibes
      @Algovibes  3 года назад +1

      Thank you very much for your kind words! :-)

  • @clarence2c408
    @clarence2c408 3 года назад +3

    I love this video.... Thank you for your devote, Sir. I rely on dividend as a way of passive income in order to achieve financial freedom.

    • @Algovibes
      @Algovibes  3 года назад +2

      Thank you my friend. Appreciate your kind comment ❤️
      That's a great idea! I am doing that as well 🤫

  • @HannesCmaritsPhotography
    @HannesCmaritsPhotography 2 года назад +1

    Great! A next step would be calculating the percentage dividend/prize. This could help to select a specific stock.

  • @MaxPorPanne
    @MaxPorPanne 2 года назад +1

    Another great vid thanks

  • @russskinner5715
    @russskinner5715 3 года назад +1

    Great video. Well explained.

    • @Algovibes
      @Algovibes  3 года назад

      Thank you so much :-)

  • @Bojan456
    @Bojan456 Год назад +1

    Absolutely amazing video

    • @Algovibes
      @Algovibes  Год назад +1

      Thank you so much mate!

  • @PavelSumik
    @PavelSumik 3 года назад +2

    unbelievable, thank you very much, I like your videos

    • @Algovibes
      @Algovibes  3 года назад

      Thank you very much :-) Truly appreciate your comment!

  • @FRANKWHITE1996
    @FRANKWHITE1996 3 года назад +1

    superb content!!!

    • @Algovibes
      @Algovibes  3 года назад

      Thanks a bunch for your support. You are helping me a lot :-)

  • @monihunziger8638
    @monihunziger8638 3 года назад +1

    Cooles Video! :) Danke

    • @Algovibes
      @Algovibes  3 года назад +1

      Danke für Deinen netten Kommentar :-)

    • @monihunziger8638
      @monihunziger8638 3 года назад +1

      @@Algovibes The internet needs (more) kind comments and more good content like yours. Cheers

    • @Algovibes
      @Algovibes  3 года назад

      @@monihunziger8638 Thanks for your kind words :-)

  • @markk4203
    @markk4203 2 года назад +2

    What additional lines of code generate the table visualization as shown in the beginning (dark background, green numbers, etc.)? Thanks for the video... great content as always!

    • @Algovibes
      @Algovibes  2 года назад +2

      Welcome :-) Thanks for watching!
      Well I just stored the data frame into a table and made it fancy using keynote :D No programming behind that.

    • @markk4203
      @markk4203 2 года назад

      @@Algovibes I wanted to see how you did that (and I've never heard of keynote). Is it several lines of code?

  • @henrygreen737
    @henrygreen737 2 года назад +1

    I expected to see 0.220 in May, like Feb, Aug, and Nov. Instead I see 0.45 which I believe is coming from the May 2021 and May 2022 dividends being added together. The code does accurately tell the month of dividend.

  • @RafeedChowdhury
    @RafeedChowdhury 3 года назад +1

    Hi, looks good! But what a dividend is used for buying a stock? I'm sorry looks like a fundamental question but does a dividend of a stock gives us additional information about a stock for buy or sell? As always, good content!

    • @Algovibes
      @Algovibes  3 года назад +1

      Thanks a lot for watching and your comment. Basically a dividend is just a (normally cash) distribution to people holding the stock. In finance theory the value of a company can be determined by discounting the Dividend (take a look at the dividend discount model if you are interested in that).
      To summarize it in easy terms: The only thing why someone would invest in a stock is that he is expecting cashflows out of it overcompensating his initial investment.
      In reality the dividend date is not that important as a buying decision as the price of the stock is discounted. Therefore it wouldn't make much sense to buy a stock only because it's paying dividend the say next day.
      There is much for to say but this should give you some ideas. Hope this is helpful for you!

  • @GoDzkRoNiKz
    @GoDzkRoNiKz Год назад

    Hi, just found this video and when I try to convert divs to df I get the error (AttributeError: 'builtin_function_or_method' object has no attribute 'get_indexer') any idea why this is happening?

  • @christianherbrich5191
    @christianherbrich5191 Год назад

    Hi, thanks for this content!
    Let me add some information, because I think the order of the 12 month could be misleading, especially if you are looking for growing dividend companies. If you record this video in mar 2021 the columns have to start in Mar (2020) to Feb (2021). For example MMM ist a Dividend King with over 63 years of dividend increasing. In your illustration it seems, that MMM has cutted his dividend in May...
    But let me say: Summarized this Video keeps what it promises to get an overview of the dividend payments each year.
    Grüße aus der Region Hannover

  • @rajeevmenon1975
    @rajeevmenon1975 2 года назад +1

    How do you take a total of the dataframe row-wise ie for each ticker symbol from Jan to Dec?

    • @Algovibes
      @Algovibes  2 года назад

      You can work with the sum function on axis=1.

  • @PaulPetta1981
    @PaulPetta1981 Год назад +1

    Very inspiring, ty! Once you show January divs:
    - can you rank them? (From larger to smaller)
    - can you assign a value for each of these ranked divs? Ex:
    1 to largest
    2 to 2nd largest
    3 to 3rd largest
    .
    .
    .
    n to n nth largest?
    Thank you!

    • @PaulPetta1981
      @PaulPetta1981 Год назад +1

      Alternatively, is it possible to add a column in which you define the nth larger value? You rock man!

    • @Algovibes
      @Algovibes  Год назад

      Thx Patrick, yes that's all possible!

  • @therealexodus7297
    @therealexodus7297 3 года назад +2

    Is there a list comprehension to show multiple months that pay dividends- e.g df[df.Jan >0] || df[df.Feb > 0] ?

    • @Algovibes
      @Algovibes  3 года назад +1

      Thanks a lot for watching and your question.
      Why do you not use Boolean Indexing?
      Syntax:
      df[(df.Jan > 0) | (df.Feb >0)]
      If this is not what you are looking for please let me know!

    • @therealexodus7297
      @therealexodus7297 3 года назад +1

      @@Algovibes Thanks this was what i was asking for, great video!

  • @paveltumpach5394
    @paveltumpach5394 2 года назад +1

    Can be used for Google spreadsheet?

    • @Algovibes
      @Algovibes  2 года назад

      Sure. You can just export the dataframe as a csv file and then show it in a spreadsheet. BTW I actually did that for the thumbnail as far as I remember :D

  • @fredbasset7561
    @fredbasset7561 3 года назад +1

    Is this searching for future paying dividends?

    • @Algovibes
      @Algovibes  3 года назад

      Thanks for watching and your comment :-) Appreciate it.
      Regarding your question: Not exactly but firms tend to pay dividends in the same month every year. You can actually check out the last years and you will see that this is the case.

  • @SarthakGarg
    @SarthakGarg 3 года назад

    Hey bro please make more complex video's 😅.. These basics could be done easily..

    • @Algovibes
      @Algovibes  3 года назад

      Thanks for your comment. I am sorry not meeting your skill level with this video but I am confident there are people who can extract value out of this.
      Please be aware that there will be much more 'basic' (I don't like the term as it is always a point of view) stuff on this channel.
      I don't only want to reach quants - they are all way smarter than me anyways ;-)
      Nevertheless I hope I am not losing you :-*

    • @irinamariamocan2745
      @irinamariamocan2745 3 года назад +2

      @@Algovibes , as a finance professional who is currently learning Python for Finance at the moment, I very much appreciate you sharing these tutorials and showing the possibilities!

    • @Algovibes
      @Algovibes  3 года назад +1

      @@irinamariamocan2745 Awesome! Appreciate your comment. Learning Python for finance is a great decision! All the best for you on your journey :-)

  • @henrygreen737
    @henrygreen737 2 года назад +1

    A question about the video I ran the example as of 05-2022. I noticed the AAPL ticker was bit off for May.
    Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
    AAPL 0.00 0.220 0.000 0.000 0.450000 0.00 0.000 0.220000 0.00 0.00 0.220 0.000
    After researching I discovered.
    Date
    2021-05-07 0.22
    2021-08-06 0.22
    2021-11-05 0.22
    2022-02-04 0.22
    2022-05-06 0.23
    Is there a way to twink this maybe something with the sum() is my guess. Again thanks for all the value you provide.

    • @Algovibes
      @Algovibes  2 года назад

      Thanks a lot mate. Don't really understand the problem, can you elaborate?

  • @zhing2878
    @zhing2878 2 года назад +1

    Big fan of your videos, thanks for posting!
    For this project, I am getting the following error when I try to use pd.read_html:
    SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1125)
    I was able to get around it with the following code, but it makes me a little uncomfortable as i basically turned off certificates.
    import ssl
    ssl._create_default_https_context = ssl._create_unverified_context

    • @Algovibes
      @Algovibes  2 года назад +1

      Thank you very much! :-)
      Can you pass me a timestamp? I am quickly checking if I am running into the same problem.

    • @zhing2878
      @zhing2878 2 года назад

      @@Algovibes Hey! apologies for not getting back to you. I updated my packages and I am no longer getting this error so ¯\_(ツ)_/¯