Google Sheets: Imported content is empty
Last verified
Imported content is empty.What it means
This #N/A error means the opposite of a fetch failure: Google successfully downloaded the page, ran your XPath (IMPORTXML) or looked for your table or list (IMPORTHTML), and found nothing that matched. The request worked; the selection came back empty.
The most common reason is that the data you can see in the browser is not in the HTML the server sends. Modern pages often load prices, reviews and tables with JavaScript after the initial page load. IMPORT functions read only the raw server response and do not run scripts, so content added later never exists from their point of view.
The second common reason is an XPath copied from browser developer tools. Dev tools show the rendered DOM, which can include elements such as tbody or attributes that are not in the source, so a copied path can match nothing in the raw HTML.
What it looks like
=IMPORTXML("https://example.com/listing", "/html/body/div[2]/main/div/table/tbody/tr[1]/td[3]")
#N/A
Imported content is empty.
// works against the raw HTML, which has no tbody:
=IMPORTXML("https://example.com/listing", "//table//tr[1]/td[3]")Why it happens
- The target data is rendered by JavaScript after page load and is absent from the raw HTML.
- The XPath was copied from browser dev tools and references elements that only exist in the rendered DOM.
- The site served Google's fetcher a different page, such as a consent screen, a bot challenge or a stripped-down version.
- IMPORTHTML was given a table or list index that does not exist; indices start at 1 and are counted separately for tables and lists.
- Class names on the page are generated and changed since the formula was written.
How to fix it
- Open the page, choose View Page Source (not Inspect), and search for the exact value you want. If it is not in the source, IMPORT functions cannot see it.
- Test the URL with a trivial XPath such as //title. If that returns the page title, the fetch works and only your XPath is wrong.
- Rewrite the XPath against the source HTML: prefer stable attributes, use contains(@class, '...') rather than full class strings, and drop tbody segments that dev tools inserted.
- For IMPORTHTML, try indices 1, 2, 3 in turn to find the right table or list.
- Look for the same data inside a script tag or JSON block in the source, or in a JSON or CSV endpoint the page calls.
- If the data only appears after JavaScript runs, use a tool that renders the page in a real browser instead.
How to stop it recurring
Write XPath against the page source rather than the rendered DOM, anchor it on stable ids or semantic attributes, and keep it short. Before building a sheet on a site, confirm the target values appear in View Source; if they do not, plan for browser-based extraction from the start. Why JavaScript pages come back empty explains the rendering gap in more depth.
Official documentation: support.google.com/docs/answer/3093342. See all Google Sheets error messages or the Google Sheets limits and quotas.
Related errors
Definitions
Quick answers
What does "Imported content is empty" mean in Google Sheets?
This #N/A error means the opposite of a fetch failure: Google successfully downloaded the page, ran your XPath (IMPORTXML) or looked for your table or list (IMPORTHTML), and found nothing that matched. The request worked; the selection came back empty. The most common reason is that the data you can see in the browser is not in the HTML the server sends.
How do I fix "Imported content is empty"?
1. Open the page, choose View Page Source (not Inspect), and search for the exact value you want. If it is not in the source, IMPORT functions cannot see it. 2. Test the URL with a trivial XPath such as //title. If that returns the page title, the fetch works and only your XPath is wrong. 3. Rewrite the XPath against the source HTML: prefer stable attributes, use contains(@class, '...') rather than full class strings, and drop tbody segments that dev tools inserted. 4. For IMPORTHTML, try indices 1, 2, 3 in turn to find the right table or list. 5. Look for the same data inside a script tag…
When an IMPORT formula cannot read the page
IMPORTXML and IMPORTHTML only see the HTML the server sends. An Autonoly extraction step reads the page in a real browser and writes rows to Google Sheets. Sites that block automated visitors can still block it.
Also see Google Sheets integration.