How to use IMPORTHTML formula in Google Sheets
Before using the IMPORTHTML formula, let’s understand its syntax.
=IMPORTHTML(URL, query_type, index)URL— The URL of the page, including protocol (http://orhttps://). Make sure to enclose the URL within double-quotes.query_type— Use “table” if you want to import a table, otherwise “list” if you’re going to import a list.index— The index of the table or list on the web page. It starts at 1. A table with index =1means that it’s the first table, index =2means that it’s the second table, and so on.
link list and table
var index = 1; [].forEach.call(document.querySelectorAll("ul,ol"), function(elements) { console.log("Index: " + index++, elements); });
var index = 1; [].forEach.call(document.getElementsByTagName("table"), function(elements) { console.log("Index: " + index++, elements); });