Why IMPORTHTML returns an empty table (and what to use instead)
IMPORTHTML is the quickest way to pull a table from a web page into Google Sheets — until it returns nothing, an error such as Could not fetch URL, or the wrong table.
How IMPORTHTML works
=IMPORTHTML(url, "table", index) asks Google’s servers to download the page’s raw HTML and read the n-th <table> (or <ul> / <ol>) from it. Everything that depends on your browser running JavaScript is invisible to it.
Four reasons it fails
- The table is built by JavaScript. The raw HTML contains an empty container; the rows appear after scripts run in your browser. Test: right-click → View page source and search for a value from the table. If it is not there,
IMPORTHTMLcannot see it. - The site blocks Google’s fetcher. You get Could not fetch URL or a page about bots.
- The page needs a login or cookies. Google’s servers are not logged in as you.
- Wrong index. Infoboxes, navigation and layout tables count too, so “table 1” is often not the one you see.
What to use instead
- Copy from the rendered page. A browser extension reads what you see after scripts have run — see copy a table to Google Sheets.
- Look for an export button or a data file. Many sites offer CSV, or load their data from a JSON address you can see in the browser’s Network tab.
- Use the site’s API if it has one.
When IMPORTHTML is still the right tool
For a static page, a stable table and a need for automatic refresh, it is excellent and free. Use it first, then fall back when the test above fails.