...
/Beautiful Soup (Scraping Data from Html Table)
Beautiful Soup (Scraping Data from Html Table)
In this lesson, we will be using Beautiful Soup for extracting the text out of HTML tables.
We'll cover the following...
Table in HTML
We will be scraping data out of an HTML table in the coming exercise. Before jumping to that, let’s take a look at how tables are constructed in HTML. Below is the markup of constructing a table in HTML.
Press + to interact
<table class="my-table" style="width:100%"><tbody><tr><th>Firstname</th><th>Lastname</th><th>Age</th></tr><tr><td>Jill</td><td>Smith</td><td>50</td></tr><tr><td>Eve</td><td>Jackson</td><td>94</td></tr></tbody></table>
-
It starts with the
<table>
tag. This tag has its class and other properties, which are helpful in scraping. -
A table’s header row or column names are usually present inside the first
<tr>
tag. They are present further inside the<th>
tag. ...