Home › Blog › Scrape data into Google Sheets

How to scrape data into Google Sheets

By the ScrapeSheet team · Published August 4, 2026 · Updated October 14, 2026 · 3 min read

Laptop with a blank screen on a light wooden desk beside a small cactus and a photo frame

In short: Scrape data from a website to Google Sheets with the built-in IMPORTHTML (for tables and lists) and IMPORTXML (for single elements by XPath) when the data is in the page's HTML. When the formulas return nothing, usually because the page draws its data with JavaScript, extract it with a browser tool and import the CSV.

Method 1 — IMPORTHTML for tables and lists

IMPORTHTML grabs a specific table or list from a page by its position. The syntax is:

=IMPORTHTML("https://example.com/page", "table", 1)
  1. Open your sheet and click an empty cell.
  2. Type the formula with the page URL.
  3. Set the second argument to "table" or "list".
  4. The third argument is the index — 1 for the first table, 2 for the second, and so on. If you get the wrong data, increment the number until you find your table.

The data lands live and refreshes periodically, which is great for something like a currency table or a leaderboard you want to keep an eye on.

Method 2 — IMPORTXML for specific elements

When you need one field rather than a whole table — a price, a title, a rating — IMPORTXML targets elements with an XPath query (XPath is the W3C language for selecting parts of a document):

=IMPORTXML("https://example.com/product", "//span[@class='price']")

To find the XPath, right-click the element in your browser, choose Inspect, then right-click the highlighted node and choose Copy > Copy XPath. Paste it as the second argument, changing any double quotes inside the XPath to single quotes so the formula stays valid. It is powerful but brittle: when the site changes its markup, the formula breaks and you have to fix the XPath.

When the formulas return nothing

Sooner or later you will hit a page where IMPORTHTML and IMPORTXML return an error, #N/A, or an empty cell. The usual reasons:

Person in a suit holding a tablet with a rising blue bar chart extending beside it

Method 3 — Extract, then import (when formulas fail)

When formulas cannot reach the data, extract it from the rendered page with a browser tool and bring the result into Google Sheets. ScrapeSheet reads the page you have open as your browser displays it, so it can also see content that scripts add after loading, and it exports to CSV or the clipboard, which Google Sheets imports cleanly.

  1. Install ScrapeSheet from the Chrome Web Store and open the page you want.
  2. Click the icon, then Extract; describe the columns in plain language if the page is messy (Pro, with your own Claude or OpenAI key).
  3. Copy the result to the clipboard and paste it into a sheet, or export it as a CSV file.
  4. For CSV, in Google Sheets use File > Import > Upload and pick "Insert new sheet(s)" or "Replace data at selected cell".

With Pro, this also handles data spread across many pages — see scraping multiple pages — so you can gather a full list and drop it into one tab. The free plan allows up to 20 rows per export and one page per run; ScrapeSheet Pro (€12.99 per month) removes both limits.

Which method to choose

If your data really lives in Excel rather than Google Sheets, the same extract-and-export idea applies — see how to scrape a website to Excel. More guides are on the ScrapeSheet blog.

FAQ

Can Google Sheets scrape a website?
Yes, with built-in functions. IMPORTHTML pulls a table or list by index, and IMPORTXML extracts elements with an XPath query. They work on static HTML but not on content that loads via JavaScript.

Why does IMPORTHTML return an error or nothing?
Common causes: the page renders its data with JavaScript, the table index is wrong, the site blocks Google's fetcher, or the content is behind a login. In those cases, extract with a browser tool and import the CSV instead.

How do I scrape a JavaScript page into Google Sheets?
Use a browser extension like ScrapeSheet to extract the rendered data to CSV, then use File > Import in Google Sheets, or paste it from the clipboard.

Sources

General information, not legal advice. Always check the website's terms and the data-protection rules that apply to you.

Keep reading

← Back to the blog · ScrapeSheet home