IMPORTHTML not working in Google Sheets? Why it fails and how to get the table anyway
You typed =IMPORTHTML(url, "table", 1) and got an error, an empty cell or the wrong table, even though you can see the table on the page. Here is why that happens and what to do about it.
How IMPORTHTML reads a page
Google's own help says IMPORTHTML returns the table or list "as defined in the HTML source". That is the key point. The page is downloaded by Google's servers, not by your browser, and the formula only sees the HTML that comes back. It does not log in as you and it does not wait for the page's scripts to build anything.
So the table you see in your browser and the table IMPORTHTML sees can be two different things.
The common failures
| What you see | Usual cause | What to try |
|---|---|---|
| "Imported content is empty" | The table is built by JavaScript after the page loads, so it is not in the HTML source | Use a tool that reads the page as your browser shows it (see below) |
| "Could not fetch url" | The site blocks automated requests, or the page needs a login | Check the URL opens in a private window. If it needs a login, IMPORTHTML cannot reach it |
| The wrong table or a list of menu links | The index counts every table (or list) in the source, including hidden ones | Try index 2, 3 and so on, and check you used "table" or "list" correctly |
| Data looks like cards, not a table | The page uses card or grid layouts, not real table tags | IMPORTHTML only sees real tables and lists; use a scraper that finds repeated blocks |
| Only the first page of results | Each page of results is a separate URL | One formula per page, or a tool that clicks Next for you |
A quick test: open the page, right click, choose View page source, and search for a value you can see in the table. If it is not in the source, IMPORTHTML will not find it, no matter which index you try.
Fixes that keep you in Google Sheets
- Wrong table: count up the index. Lists and tables are counted separately, so
"list", 1and"table", 1are different things. - Static copy needed: once it works, copy the range and use Paste special, values only, so later refreshes do not change it.
- IMPORTXML can pull a specific element with an XPath, but it reads the same HTML source, so it fails on JavaScript tables for the same reason.
When the table only exists in your browser
If the data is built by scripts, sits behind a login, or is a grid of cards, you need something that reads the page after it has loaded, in your own browser.
List & Table Scraper is a free Firefox add-on we make that works this way. Open the page as you normally would (logged in, filters set), click its toolbar button, and it outlines the repeated data it found and shows a preview.
- Wrong block? Click Try another.
- Rename or remove columns in the preview.
- Click Copy and paste into Google Sheets, or download CSV, Excel (.xlsx) or JSON.
It also handles Next buttons and infinite scroll. The free version reads up to 3 pages per run; Pro reads up to 500. Export is free either way, and the data stays in your browser: no account, and nothing is sent to a server.
The trade-off: a copy made this way does not refresh by itself like IMPORTHTML does. Run it again when you need fresh data.
Which should I use?
| Situation | Use |
|---|---|
| A plain table that shows up in View page source | IMPORTHTML |
| You want the sheet to update on its own | IMPORTHTML (if the data is in the source) |
| "Imported content is empty" or the table is built by scripts | List & Table Scraper |
| The page needs a login | List & Table Scraper |
| Cards, product grids, search results over several pages | List & Table Scraper |
Related: How to export a Wikipedia table to Excel, Google Sheets or CSV and How to scrape multiple pages into one spreadsheet.