Blog/How to Extract a Table From a Website to Excel or CSV

How to Extract a Table From a Website to Excel or CSV

Extract a table from a website to Excel or Google Sheets with Excel From Web, IMPORTHTML, clean paste shortcuts, or a one-command CSV download.

AA
Akshay A
·Posted 1 month ago
NotesText ExpandersLinksWebpage SearchDownload Tables

Key takeaways

  • Excel: Data, then From Web, paste the URL, pick the table, click Load.
  • In Google Sheets, an IMPORTHTML formula pulls the table and refreshes about every hour.
  • Both fail behind logins or on JavaScript tables; export those from the browser as CSV.

To extract a table from a website to Excel, go to Data, then From Web, paste the URL, pick the table in the Navigator and click Load. In Google Sheets, type =IMPORTHTML("URL", "table", 1). If the table is behind a login or built by JavaScript, both fail, so download it from your browser as CSV instead.

This guide is for anyone moving a web table into a spreadsheet, from a one-off copy to a weekly refresh.

How do I extract a table to Excel with From Web?

Use From Web, built into Excel for Microsoft 365 via Power Query.

  1. On the Data tab, click From Web (or Get Data, then From Other Sources, then From Web).
  2. Paste the page URL and click OK.
  3. In the Navigator, click each entry under Suggested Tables to preview it.
  4. Click Load, or Transform Data to remove columns or fix types first.

The import stays connected: right-click the table and choose Refresh for the latest numbers. If your table is missing, try Add Table Using Examples and type two values from it.

How do I import a web table into Google Sheets?

Use IMPORTHTML. Example:

=IMPORTHTML("https://en.wikipedia.org/wiki/List_of_largest_cities", "table", 2)

  • The third argument is the table's position on the page, counting from 1; change it if you get a layout table.
  • Results refresh about every hour, per Google's spreadsheet settings help.
  • To freeze the data, copy the range and paste with Ctrl + Shift + V (values only).

How do I copy a small table without breaking formatting?

Select only the table and paste as plain values.

  1. Click before the first header cell, then Shift-click after the last data cell.
  2. Copy with Ctrl + C (Cmd + C on Mac).
  3. Google Sheets: Ctrl + Shift + V (Cmd + Shift + V) pastes values. Excel: Ctrl + Alt + V, then Text or Unicode Text; on Mac, Edit, then Paste Special.

Then check for shifted columns and numbers stored as text.

How do I download tables behind a login as CSV?

Export them from the page you already have open. With SuperCommands for Chrome, Edge and Brave:

  1. Load every row first: set page size to maximum and apply filters.
  2. Press Alt + S, type Download All Tables and press Enter.
  3. Each standard HTML table downloads as its own CSV file.

It reads real HTML tables on the active page only: no pagination, card layouts or schedules. Canvas charts, table images and virtualized grids are not guaranteed (Download All Tables docs). For data across many pages, a scraper fits better; see SuperCommands vs Instant Data Scraper and our table downloader roundup.

Which one should you pick?

  • Pick Excel From Web or IMPORTHTML if the table is public and you want it to refresh.
  • Pick copy and paste as values if you need a few rows once.
  • Pick Download All Tables if the table is behind a login, built by JavaScript, or one of several on a page; SuperCommands is free and open source.
  • Pick a scraper for hundreds of rows across pages; see SuperCommands vs Data Miner.

FAQ

How do I copy a table from a website into Excel without formatting?

Copy the table, then press Ctrl + Alt + V in Excel and choose Text. In Google Sheets, Ctrl + Shift + V pastes values only.

Can Excel pull a table from a website automatically?

Yes. Data, then From Web creates a refreshable connection, but only for pages Excel can load without your browser login.

Why does IMPORTHTML return "Could not fetch URL" or an empty result?

The page may block automated requests, need a login, or build the table with JavaScript. Try another table index, then export from the browser.

Can I export a table to Excel format directly with SuperCommands?

It downloads CSV files, which Excel opens directly. Save as .xlsx from Excel if you need that format.

Try SuperCommands Extension

Find saved browser work and run everyday browser commands.Built for people who like moving around the browser with shortcuts.

Use Cases:

  • Image download → Review discovered page images and download the selected files
  • Local backup → Save a ZIP before reorganizing your extension data
  • Workspace autosave → Optionally save supported tab changes while a Workspace runs
  • Morning Workspace → Save Gmail, Calendar, and project URLs, then launch the named set
  • Research Link → Collect selected sources as an ordered Link
Install SuperCommands

Recommended blogs