Sentiment Analysis of Stock Market in Python (Part 1)- Web Scraping Financial News

Bee Guan Teo
The Handbook of Coding in Finance
7 min readOct 4, 2021

--

Photo by Obi Onyeador on Unsplash

Stock market sentiments can be valuable info that hints at future price action. Many often stock investors react to the market sentiments in making their decision to buy or sell their assets. Hence, stock sentiment analysis has become a popular and useful technique to gauge the investors’ opinions of a specific stock and plan for an investment strategy.

One direct way to understand market sentiments is by following and reading the news on daily basis. However, this can be quite a tedious process. Here, we are going to explore how can we use Python to perform the stock sentiment analysis for us.

We will break this sentiment analysis process into two main parts:

  1. Web scraping financial news and preprocessing the text data
  2. Calculating sentiment score and visualization (Presented in Part 2 Article)

In this article, we will only focus on the first part and the second part will be presented in another article.

Disclaimer: The writing of this article is only aimed at demonstrating the steps to perform stock market sentiment analysis in Python. It doesn’t serve any purpose of promoting any stock or giving any specific investment advice.

Prerequisite Python…

--

--