Retrieving data from tables on a web page
In order to query tables within web pages, you have a number of options. The examples illustrated below are querying some sample tables on this page. Each example links back to the demo sandbox for you to try yourself. By default, the first table on the page is retrieved, but you can query for specific tables within a page with four different methods. So if a web page only has one table you can simply supply the web page's URL as shown below.
The easiest way to explore a page likely will be with this method. This is a zero-based index so the first table will be 0. You just need to append a hashtag, and the index enclosed with square brackets. Below is an example using this method.
Here is another example of getting the second table on the webpage.
You can also select a table using its class attribute as defined in its html. In order to this you just need to append a hashtag, and a period preceding the class name. Below is an example using this method.
This method can be combined with using the table index so if there are two tables with the class
sample-tableyou would use the query below.
Another way to choose a table that you want to query is to append #+ to the end of the website URL with a string that you see in the table.
Like with the html class attribute selector this method can be combined with selecting a table index as more than one table may have the string that's being supplied. The example below illustrates this.
If you own the page the most reliable way to query a specific table is likely to be this method. You can use a table's html attribute id to indicate to UseSQL which table you want to query. An example can be shown for a table that has an