In this BeautifulSoup Python web scraping tutorial, we will go through a simple program using which you can scrape news.google.com website and fetch the latest news of the day programmatically.
✅ Python packages used in the program
==================================
In this tutorial, we will use the following Python packages:
BeautifulSoup (https://pypi.org/project/beautifulsoup4/)
Requests (https://pypi.org/project/requests/)
The requests Python module is used for getting the contents of the Google news website to our local machine or to be more specific, to the Python program that we are writing.
The BeautifulSoup package is used for parsing through the HTML code and fetch the required data. In our case, we will be using it for fetching the news headlines from the HTML code of the Google new website.
✅ How to install the Packages
======================
Install the packages to your local machine using PIP.
pip install beautifulsoup4
pip install requests
✅ Additional Information
=====================
Towards the end of this video, you will also see how to format the news titles in a readable way and how to print each news title in a separate line using the for loop in Python.
Once you are able to write and execute this program on your machine, YOu should have a good idea of how the BeautifulSoup Python package works and where it can be used.
✅ OTHER LINKS AND RESOURCES
=============================
🔴 Subscribe to this channel
/ ances200. .
🔴 YouTube Channel
/ ances200. .
🔴 Python for Beginner Playlist
https://www.youtube.com/playlist?list...
🔴 My Facebook Page
/ therealanoopnair
🔴 Follow me on Twitter
/ ances2006
🔴 Follow me on Instagram
/ therealanoo. .
🔴 Connect with me on LinkedIn
/ anoop1