From the course: Using Python for Automation
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Extract data from HTML code - Python Tutorial
From the course: Using Python for Automation
Extract data from HTML code
- After you receive a response to your request for HTML code, the next step is to extract the specific pieces of data that you need. This is where the real magic of web scraping happens. In this lesson, you'll discover how to extract data from HTML code using Beautiful Soup in Python. - [Guide] This webpage contains a public catalog of books that are in English and categorized as humorous. Assume that you've already created a request to get HTML code from this webpage and parsed the response. So your next goal is to extract data from the parsed HTML response. Specifically, you'd like to find all the book titles that appear on this webpage and print them out. Use your browser's inspect tool to inspect the first book that appears on this page. In the HTML code that pops up on the right, hover over the element that corresponds to the title of the first book that appears on this page. This HTML element has the tag A and the class block item title. Inspect the next book. The HTML element…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Use BeautifulSoup for automating web scraping1m 53s
-
(Locked)
Explore HTML structure1m 59s
-
(Locked)
Inspect your data source2m 10s
-
(Locked)
Request and parse HTML code2m 4s
-
(Locked)
Extract data from HTML code2m 49s
-
(Locked)
Prepare for scraping multiple pages1m 43s
-
(Locked)
Scrape multiple pages3m 59s
-
(Locked)
-
-
-