Grab a web page’s data with Google Sheet

Share:
Google Sheet has a formula that allows you to grab a web page’s list or table of data into your sheet of choice. It’s called IMPORTHTML.

Sample Usage:
Example 1: =IMPORTHTML("https://en.wikipedia.org/wiki/List_of_best-selling_books", "table", 1)
Example2: =IMPORTHTML("https://www.mohfw.gov.in/", "table", 1)

Syntax:  =IMPORTHTML(url, query, index)

url - The URL of the page to grab, including protocol (e.g. http://).
The value for url must either be enclosed in quotation marks or be a reference to a cell containing the appropriate text.

query - Either "list" or "table" depending on what type of structure contains the desired data.

index - The index, starting at 1, which identifies which table or list as defined in the HTML source should be returned. The indices for lists and tables are maintained separately, so there may be both a list and a table with index 1 if both types of elements exist on the HTML page.

Result Screenshot of Example 1:

Result Screenshot of Example 2:
Demo Video:

Hi! I am Sartaj Husain. I am a Professional Software Developer, live in Delhi. I write blogs in my free time. I love to learn and share the knowledge with others because it is no good to try to stop knowledge from going forward. So free posts and tutorials. more..

No comments