How to scrape data from a table

In this tutorial you can learn how to scrape any table containing information about game resultscourse listingsupcoming releases, or otherwise.

I'm using the NBL Canada website's stats as an example, if you want to follow along.

Scraping One Table

1. Use a regular Select command to get each of the table's row titles, by clicking on each. This should create a Begin new entry and Extract command automatically. You can rename these elements if you like.

2. Click on the plus button beside Begin new entry. Create a new relative selection.

3. Click on the name of the first team, then click on the number beside in under W. This should define the relative selection for each of the teams. Rename this select to wins.

4. Repeat steps 2 and 3, creating and defining new relative selections for each column in the table. Rename each to the name of the column.

5. You can now run your project, and the results will look something like this:

Scraping Multiple Tables

Scraping multiple tables and aggregating the results is easy, and almost identical to scraping a single table.

1. Instead of using your select command to get each of the rows, use a select to get the title of each table, or use the zoom feature to simply each table itself.

This will create an automatic Begin New Entry and Extract command. Rename the selection to table.

2. Click on the plus button beside the Begin New Entry command and create a new relative selection.

3. Click on the title of each table, then on the first team name. Do the same thing with second table, and then for the second team. This should relatively select each of the team names for each table separately.

4. From here, proceed with steps 2–5 as if you were selecting a single table. Your project will end up looking like this:

Another way to scrape multiple tables

To scrape multiple tables less elegantly, follow the method for an individual table, and select the title of each row in every table. To get the title of the table, you can use a relative select from each team to the table's title.

Have more questions? Submit request!


Article is closed for comments.