Course Content
Web Scraping with Python
Web Scraping with Python
Challenge: The BeautifulSoup Object
Task
Swipe to show code editor
Print the first h1
of the page tag using BeautifulSoup
:
- Import the
BeautifulSoup
frombs4
. - Create the
BeautifulSoup
object and assign it to the variablesoup
. - Access the first
<h1>
tag using the soup variable and print its content.
Solution
Switch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?
Thanks for your feedback!
Section 2. Chapter 3
Challenge: The BeautifulSoup Object
Task
Swipe to show code editor
Print the first h1
of the page tag using BeautifulSoup
:
- Import the
BeautifulSoup
frombs4
. - Create the
BeautifulSoup
object and assign it to the variablesoup
. - Access the first
<h1>
tag using the soup variable and print its content.
Solution
Switch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?
Thanks for your feedback!
Section 2. Chapter 3
Switch to desktop for real-world practiceContinue from where you are using one of the options below