Google Sheets can import simple tables directly from a webpage using the IMPORTHTML function.
For example:
=IMPORTHTML("https://en.wikipedia.org/wiki/Roy_Hodgson","table",2)
This imports the second table found on the Roy Hodgson Wikipedia page.
The function follows this structure:
=IMPORTHTML("URL","query",index)
- URL: The webpage containing the data
- Query: Either
"table"or"list" - Index: Which table or list on the page to import
The index starts at 1, so if the wrong table appears, try changing the final number until you find the one you need.
This is a quick way to bring simple, publicly available web data into Google Sheets without copying and pasting it manually.
However, it will not work well on every website. The data must be stored in a suitable HTML table or list, and websites with dynamically loaded content may require a different approach.
Example of IMPORTHTML
For this example, we will extract a table from the Wikipedia page for the TV show Taskmaster.

First, scroll through the webpage and try to work out the index of the table you want to extract. In this case, it looks like the table we need is the second one on the page.
However, some content may be stored as a table in the underlying HTML even if it does not look like one on the webpage. You may therefore need to try a few different index numbers before finding the correct table.
Enter the IMPORTHTML formula into a cell, adding the webpage URL, the query type and the index number of the table you want to import.
The URL and query type should be enclosed in quotation marks, while the index number should not be.
Press Enter and, hopefully, the table will populate your Google Sheet. If the result is not what you expected, try changing the index number.
And that’s it - with one simple formula, you can pull useful web tables straight into Google Sheets within seconds.

