Imports data from a table or list within an HTML page. Learn more
The IMPORTHTML(url, query, index) function in Google Sheets is a built-in function that allows you to import data from a specified URL into your spreadsheet.
It is part of the Google Sheets' IMPORT family of functions.
Here is a breakdown of the function's parameters:
url: This parameter specifies the URL of the webpage from which you want to import data. It should be enclosed in quotation marks (" ").
query: The query parameter is used to specify the type of data you want to import and how it should be extracted from the webpage.
The format of the query depends on the value of the index parameter.
index: This parameter determines the table from the webpage that you want to import. It can be either 1, 2, 3, or -1.
If index is 1, the function imports a table from the webpage.
If index is 2, the function imports a list from the webpage.
If index is 3, the function imports a specific table based on a CSS selector from the webpage.
If index is -1, the function imports all tables or lists from the webpage.
The IMPORTHTML function returns an array containing the imported data.
You can use this function to fetch and analyze data from websites directly within your Google Sheets, eliminating the need for manual data entry.
Please note that the IMPORTHTML function has some limitations, such as the maximum number of cells it can import and the frequency at which it can update the imported data.
You can find more information about these limitations in the Google Sheets documentation.