IMPORTXML stock price not working in Google Sheets?
When GOOGLEFINANCE can't pull something, the next thing people try is scraping a finance site with IMPORTXML or IMPORTHTML. It works — until it doesn't. Here's why it breaks, and what to do instead.
Free to start · no sign-up needed · real-time on every plan.
July 24, 2026 · 5 min read
1. The page is JavaScript-rendered — IMPORTXML can't see the price
This is the number-one cause. IMPORTXML fetches the raw HTML of a URL; it does not run JavaScript. Most modern finance sites load their prices with JS after the page arrives, so IMPORTXML sees an empty shell and returns #N/Aor "imported content is empty," even when your XPath is perfect. If the number is missing from View → Page source, IMPORTXML can't read it.
2. The XPath is wrong — or the site changed its HTML
Scraping ties your formula to a page's exact structure. A query like =IMPORTXML(url, "//span[@class='price']") works only until the site renames a class or moves an element — then it silently breaks. Copy-pasted XPath from an old tutorial usually no longer matches the live page.
3. 'Could not fetch url' — rate limits or blocking
Google fetches the page from shared servers. Sites rate-limit or block those, so you'll see Could not fetch url or Resource at url not found— intermittently at first, then constantly once you're flagged. Refreshing many cells at once makes it worse.
4. It works today and breaks tomorrow
Even a scrape that works is fragile by design. You're depending on someone else's page not changing, not blocking you, and not rendering with JavaScript. For a portfolio you actually rely on, that's a formula that will fail at the worst time.
The fix: stop scraping
For basic US stock prices, plain GOOGLEFINANCE is steadier than any scrape — just remember it's ~20 minutes delayed and freezes when the tab is closed. And if you're reaching for IMPORTXML because GOOGLEFINANCE couldn't give you real-time prices, crypto, or dividends, Stealth Quotes does all of that with no formulas and no scraping — you type a ticker and get a live price that can't break when a website redesigns.
Keep reading
Frequently asked questions
Why is my IMPORTXML stock price not working?
Most often the source page is JavaScript-rendered (IMPORTXML can't run JS, so it sees an empty page), the XPath no longer matches because the site changed its HTML, or Google can't fetch the URL (rate limits or the site blocks scraping). All three return #N/A or 'imported content is empty.'
Is scraping stock prices with IMPORTXML against the rules?
Many finance sites' terms of service prohibit scraping, and they actively block it with bot detection. Even when it works, it's fragile — a layout change breaks your XPath overnight.
What's more reliable than IMPORTXML for stock prices?
GOOGLEFINANCE is more stable for basic US stock prices (though delayed ~20 minutes and closed-tab frozen). For real-time prices, crypto, or anything GOOGLEFINANCE lacks, a purpose-built no-formula tool like Stealth Quotes avoids scraping entirely.
No XPath. No scraping. No breakage.
Type a ticker, get a real-time price — stocks, crypto and dividends, with no formulas to maintain. Free, no sign-up.