This project scrapes news articles related to the Indian stock market from Google News, performs sentiment analysis on the article titles and descriptions using VADER (Valence Aware Dictionary and Sentiment Reasoner), and saves the analyzed data to an Excel file.
Clone the repository:
git clone 'https://github.com/Underemployed/google_news_sentiment_analysis.git'
Install the required dependencies:
pip install -r requirements.txt
Run the google_news.py
script to scrape news articles and save them to a CSV file named articles.csv
.
Run the sentiment.py
script to perform sentiment analysis on the articles in articles.csv
using VADER and save the analyzed data to an Excel file named sentiment_analysis.xlsx
.
The following libraries are used in this project:
- urllib.request: For sending HTTP requests and retrieving webpage content.
- bs4 (BeautifulSoup): For parsing HTML and extracting data from webpages.
- requests: For making HTTP requests.
- newspaper: For article extraction and natural language processing.
- time: For time-related functions.
- csv: For reading and writing CSV files.
- pandas: For data manipulation and analysis.
- vaderSentiment: For sentiment analysis using VADER.