This is a step-by-step description of how to combine multiple tables from one webpage into one table with categories as output. You can also apply this technique to combine tables from other sources as well (like from folder method for example or multiple different webpages (see in an upcoming article)).
Sometimes the page you want to scrape has multiple tables like here:
And you want to combine them into 1 with a Category-column like so:
I will present 2 methods here:
- Append-method: This is the obvious one and is fast for just a few tables.
- Add-Column-method: A bit more complicated but will be faster for a large number of tables and is also suitable for a dynamic number of tables.
You will also find 2 options at the end of this article:
- Use custom functions for multi-step table transformations
- Use dynamic filters to select the desired tables