Extracting famous quotes of different personalities.
A step by step guide to understand Web Scrpaing by extracting the quotes of many famous personalities available at quotes.toscrape.com and storing that data into the CSV file which can be later used for further Analysis.
Libraries used in this project are:
pandas
: To Store the data in DataFrame and later converting it to CSV file.bs4
: To import BeautifulSoup in order to extract elements from the Website.requests
: To send and get request from the website in order to scrape its data.
- Importing relevant Libraries.
- Extracting different basic elements and their texts from the website like title, author names and some quotes.
- Extracting the data from multiple pages using
while
loop. - Creating a dataframe from the extracted data.
- Storing the data in a CSV file.
In order to run this program, make sure that you have all the required libraries installed, use the following commands for installation:
pip install pandas
pip install beautifulsoup4
pip install requests
Also you should be having a browser like Mozilla Firefox, where you can inspect the website by Right Click -> Inspect
Gaurav Kumar