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

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…

Contents