Kursinnehåll
Web Scraping with Python
Web Scraping with Python
3. Working with Element Attributes in Beautiful Soup
Challenge: The BeautifulSoup Object
Uppgift
Swipe to start coding
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 thesoup
variable and print its content.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 2. Kapitel 3
Challenge: The BeautifulSoup Object
Uppgift
Swipe to start coding
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 thesoup
variable and print its content.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 2. Kapitel 3