A Python CLI project that scrapes the latest national news headlines from The Hindu using Requests and BeautifulSoup.
- 🔍 Scrapes real-time headlines from The Hindu's national news section.
- 🧹 Automatically cleans and formats headline text.
- 🖥️ Displays headlines in a numbered list for easy reading.
- 🧠 Demonstrates how to find and parse HTML tags with BeautifulSoup.
-
Clone the project
git clone <your-repo-url> cd Project_14_News_Headlines_Scraper
-
Install dependencies
pip install requests beautifulsoup4
-
Run the script
python news_scraper.py
Fetching latest headlines from The Hindu...
1 . Supreme Court to hear key case on electoral bonds today
2 . PM addresses G20 meeting on climate change
3 . New Parliament session likely to begin next week
4 . Government issues new digital privacy guidelines
5 . Heavy rains predicted in Southern states- Using requests to fetch HTML content.
- Parsing and navigating DOM elements using BeautifulSoup.
- Extracting text from anchor (
<a>) tags. - Writing a clean and robust CLI script.
- Include headline URLs for direct reading.
- Scrape multiple sections (e.g., international, sports).
- Export results to JSON or CSV for later use.
- Add desktop notifications for breaking news.