Google Sheets Function: IMPORTHTML
The IMPORTHTML function allows importing data from a table or a list on a web page.
Note that only the values are imported (without formatting).
Usage:
=IMPORTHTML(url, query, index)
Example of Use
The goal here is to import the values from the table of the list of 729 colors from this site.
Enter in the IMPORTHTML function:
- url: the URL of the web page
- query: "table" if it’s a table or "list" for a list
- index: the number of the table or list on the page (here, the color table is the first table on the page, so the index is 1)
=IMPORTHTML("https://www.sheets-pratique.com/en/course/color-list","table",1)
Preview of the imported data:
In an HTML page, a table is contained within the <table></table> tags while a list is contained within the <ul></ul> or <ol></ol> tags.