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:

=IMPORTHTML("https://www.sheets-pratique.com/en/course/color-list","table",1)

Preview of the imported data:

google sheets example import web importhtml
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.