Course Content
Python Web Scraping Made Simple: Building a Basic Web Scraper
Python Web Scraping Made Simple: Building a Basic Web Scraper
Store Scraped Data Into a Pandas DataFrame
Storing scraped data in a pandas
DataFrame is a convenient way to manipulate and work with the data. pandas
is a powerful library in Python that provides easy-to-use data structures and data analysis tools.
A DataFrame is a 2-dimensional labeled data structure with columns of potentially different types. You can think of it as a spreadsheet, SQL table, or a dictionary of Series objects. It is generally the most commonly used pandas
object.
Task
- Import
pandas
and initialize an empty DF; - Scrape the country name (find all instances on the web page);
- Scrape the capital city (find all instances on the web page);
- Append the scraped values (
country_name
,item
) in thedf
.
Everything was clear?
Section 1. Chapter 5
Start learning today and achieve
coding mastery
- Master Python, SQL, JavaScript & more.
- Learn with Step-by-Step Lessons.
- Get Ready for Real-World Projects.
- Earn a Certificate Upon Completion.