5 alternatives to IMPORTHTML when it can't fetch the table
=IMPORTHTML() is the obvious first thing to reach for, and on the right page it's genuinely the best tool available. It's free, it lives in the sheet, and it re-fetches on its own — so a static, public HTML table stays up to date without you touching it again.
The trouble starts when the page isn't that. IMPORTHTML fetches raw HTML from Google's servers; it doesn't run JavaScript and it isn't signed in as you. If the table is built in the browser after load, or sits behind a login, no amount of tweaking the index will help. Here are five real alternatives, and where each one actually fits.
1. IMPORTXML with an XPath
=IMPORTXML(url, "//table[2]//tr") targets an exact element instead of a numbered table, which makes it the right upgrade when your data isn't a real <table> — a grid of <div>s, a definition list, a set of spans.
- Good for: oddly structured but static pages; grabbing one column instead of the whole table.
- The catch: it's the same fetcher underneath, so it still can't run JavaScript or log in. If IMPORTHTML got
#N/Abecause the page is JS-rendered, IMPORTXML gets#N/Atoo. XPath is also brittle — a small redesign breaks your formula silently.
2. IMPORTDATA for CSV or TSV endpoints
=IMPORTDATA("https://example.com/data.csv") pulls a delimited file straight in. It's worth ten minutes of hunting: plenty of sites that render a fancy JavaScript table are quietly feeding it from a .csv URL you can use directly.
- Good for: government data portals, exports, anything with a "Download CSV" link you can copy the address of.
- The catch: it only works on a file that's already CSV or TSV and publicly reachable. Point it at an HTML page and you'll get one messy column of markup.
3. Google Apps Script with UrlFetchApp
Writing a short script gives you real control — headers, pagination, JSON parsing, scheduled triggers, and cleanup before anything lands in the sheet.
- Good for: recurring pulls, multi-page sources, and APIs that return JSON rather than HTML.
- The catch: you have to write and maintain code, and it does not solve the core problem:
UrlFetchAppfetches HTML the same way IMPORTHTML does, without running scripts. It only beats the built-ins if the site exposes an API or a data endpoint you can call directly.
4. A browser extension that reads the rendered table
This is the one that covers the cases the formulas can't. Your browser has already run the page's JavaScript and is already signed in — the finished table is on screen. An extension reads that rendered HTML instead of re-fetching the page.
Table to Sheets works this way. Click the toolbar button, it finds every table on the page, and you export the one you want. CSV export is free and unlimited, with no row cap. The $5/mo Pro adds one-click export to a new Google Sheet, plus a clean mode that strips [1] footnote markers, thousands separators, and leading $/£ so your numbers arrive as numbers. It reads structure, not pixels — no OCR — runs only when you click it, and doesn't track you.
- Good for: JavaScript-built tables, dashboards, and anything behind a login.
- The catch: it's a manual grab, not a live formula. If you need the sheet to refresh itself hourly, this isn't it. (No install needed for a one-off? The same conversion runs in the browser at DubeTools.)
5. The site's own API or export button
Check for this first, honestly. A documented API or a real "Export to CSV" button gives you clean, typed, complete data with no scraping fragility and no terms-of-service grey area.
- Good for: basically every case where it exists.
- The catch: most sites don't have one, and some gate it behind a paid tier or an API key.
How to pick
- Look for an export button or API. Best data, least maintenance.
- Need it to auto-refresh? Stay in formula-land — IMPORTDATA if there's a CSV, IMPORTXML if the page is static, Apps Script if there's an API.
- Getting
#N/Aon a table you can plainly see? The page is JS-rendered or login-only. Grab it from the browser instead — no formula will reach it.
The short version
- IMPORTHTML and IMPORTXML share the same blind spot: no JavaScript, no login.
- IMPORTDATA and Apps Script only win when the site exposes a CSV or an API.
- For rendered or signed-in tables, a browser-side export is the reliable answer.
- Always check for an official export first — it beats all four of the others.
Get Table to Sheets — free
Export any table on any web page to a clean CSV in one click. Free and unlimited — no row caps. One click to Google Sheets with Pro.
Add to ChromeRelated guides
- Pasted a web table and it all landed in one column? Here's why
- How to copy a table from a website into Excel — without the mess
- How to export an HTML table to Google Sheets (3 reliable ways)