Web scraping is a very powerful tool to learn for any data professional. With web scraping the entire internet becomes your database. In this tutorial, we show you how to parse a web page into a data file (CSV) using a Python package called BeautifulSoup.
In this example, we web scrape graphics cards from NewEgg.com.
Python Code:
Sublime:
Anaconda:
JavaScript beautifier:
If you are not seeing the command line, follow this tutorial:
Table of Contents:
0:00 - Introduction
1:28 - Setting up Anaconda
3:00 - Installing Beautiful Soup
3:43 - Setting up urllib
6:07 - Retrieving the Web Page
10:47 - Evaluating Web Page
11:27 - Converting Listings into Line Items
16:13 - Using jsbeautiful
16:31 - Reading Raw HTML for Items to Scrape
18:34 - Building the Scraper
22:11 - Using the "findAll" Function
27:26 - Testing the Scraper
29:07 - Creating the .csv File
32:18 - End Result
--
At Data Science Dojo, we believe data science is for everyone. Our data science trainings have been attended by more than 10,000 employees from over 2,500 companies globally, including many leaders in tech like Microsoft, Google, and Facebook. For more information please visit:
https://hubs.la/Q01Z-13k0--
Unleash your data science potential for FREE! Dive into our tutorials, events & courses today!
--
📱 Social media links
--
Also, join our communities:
_
Want to share your data science knowledge? Boost your profile and share your knowledge with our community:
https://hubs.la/Q01ZZNCn0#webscraping #python #beautifulsoup