Web-Scraping using BeautifulSoup lib in Python for creating a dataframe to retrieve the Safest Cars rating in Latin NCAP website for the year 2020-2023 and before 2020.
- Importing request library to extract site and parsing in HTML format using Beautiful Soup lib
- Extracting text(with tags) for each of the columns(brand,vehicle-model,date,adult-safety,child-safety,star rating,safety measures) using selection (html)tags
- Extracting the text from the selection tags before appending each to respective lists.
- Creating a Dictionary key-value pair for adding multiple values to a unique key
- Creating a dataframe from the dictionary and exporting the same as a csv file.
NOTE: Since the data from 2020-Present and before 2020 are represented in different formats(deletion of variables), two csv files are made with different variables.