Power Query can pull tables straight off a web page into Excel or Power BI, and the working method is to use Data > From Web (get data from the web), paste the page address, and then pick the table from the navigator list rather than accepting the whole page. The result is a query you can refresh later with one click, so the numbers stay current without copy-paste. Menu labels differ slightly by version, device and region, so if a name below does not match exactly, look for the closest equivalent.

This works best on pages that render real HTML tables, such as statistics pages, product lists or government data. Pages that load their content with heavy scripts after the first load can still work, but are the most common reason for a disappointing result.

What You'll Need

  • Excel for Microsoft 365, Excel 2016 or later on Windows, or Power BI Desktop. Excel for Mac has Get Data options but the web connector wording and behaviour differ; the steps below describe the Windows desktop and Power BI route.
  • A link to the page that contains the data, ideally the direct page rather than a search result.
  • A stable internet connection, and permission to access the page if it sits behind a login.
  • Roughly knowing which table you want, so you can identify it in the navigator.

Step-by-Step

  1. Copy the full page address from your browser, including any part after the question mark. Many data pages keep the specific view or filter in the query string, so trimming it can change the data you get.
  2. Open the data source. In Excel, go to the Data tab and choose Get Data > From Other Sources > From Web. In Power BI Desktop, choose Get data > Web. Older Excel builds show a single From Web button on the Data tab instead of the menu.
  3. Leave the connection simple. Paste the address into the URL box and choose the Basic option, not a Windows or organisational account credential, unless the site genuinely needs a login. If the site requires sign-in, complete that in the browser first, then use the same browser session where offered.
  4. Wait for the Navigator window. Power Query loads the page and lists what it found on the left: one or more Table entries, sometimes Suggested Tables, plus the whole document. Click each candidate and look at the preview on the right.
  5. Choose the table, not the page. Selecting the top-level document gives you raw HTML that needs cleaning. Selecting a table entry gives you structured columns already. Tick Select multiple items only if you want more than one table combined later.
  6. Load it properly. Use Transform Data if you expect cleanup work, which opens the Power Query Editor. Use Load to drop a clean table straight into a worksheet or the data model. Choosing Transform first is safer because you can rename and retype columns before the data lands.
  7. Clean up in the editor. Set the header row with Home > Use First Row as Headers if the first row is really a title. Change column types by clicking the small type icon in each header, using Text for codes with leading zeros and Decimal Number or Whole Number for figures. Remove empty columns and rows via right-click.
  8. Close and load. Choose Home > Close & Load. The query appears in the Queries pane, and from then on Data > Refresh All re-reads the page and updates your table.
  9. Run it in reverse when needed. To change the source later, right-click the query and open the editor, then edit the Source step in the Applied Steps list on the right. Do not build a second query from scratch for a small change.

Common Mistakes

The biggest one is loading the whole page instead of a table, which produces a single column of HTML text. If you see tags, you picked the document.

Second, pasting a shortened URL. Many sites use the address to determine which page or filter to show, so keep it intact.

Third, ignoring column types. Power Query often guesses text where you want numbers, which breaks totals and sorting further downstream. Check the type icons before loading.

Fourth, expecting the query to survive a site redesign. If the page structure changes, the query can return errors or different columns on the next refresh; that is normal and needs a source step edit, not a new file.

Tips

  • Use the browser's developer tools or simply the page address to confirm you are on the exact page view, not a redirect.
  • Rename the query to something meaningful before loading, so the Queries pane stays readable.
  • Keep the Applied Steps tidy by deleting steps you experimented with; each step is visible and editable.
  • If the site offers a downloadable CSV or API feed, prefer it. A structured download is far more reliable than scraping HTML tables, which break when the layout changes.
  • For repeated work, save the workbook as a template and copy it, so the connection setup is not repeated.

Troubleshooting

No tables appear in Navigator. The data is probably rendered by scripts. Try the site's print view or an export link, or check whether the vendor offers a data feed. As a fallback, use Get Data > From Web and inspect the document, but be ready for manual cleanup.

A credential or sign-in prompt appears. For public pages, confirm you did not select a credential type that requires a login. For pages behind an account, sign in through the browser and use the session option if your version offers it; do not embed a password in the query text.

Refresh fails later. Start with the simple checks: confirm the page still loads in a browser, check your connection, and refresh again. If it still fails, open the editor and look at which Applied Steps shows an error, often the Source step if the address changed.

Numbers arrive as text. Change the column type in the editor and let the change apply to the whole column, then close and load again. Watch for currency symbols and thousands separators that block conversion.

The table looks right but rows are missing. Some pages paginate, with only the first page loaded. Look for a page parameter in the address and adjust it, or use the site's own download if one exists.

Frequently Asked Questions

Does this work on Excel for Mac?

Excel for Mac includes Get Data options, but the web connector's menus and behaviour differ from Windows, and some authentication modes are limited. The workflow is similar but the wording may not match exactly.

Will the data update on its own?

Not automatically unless you set up a refresh schedule, which is available in Power BI and in Excel with the right setup. Otherwise use Refresh All when you want current numbers.

Can I import PDFs or images this way?

No, the web connector reads HTML pages. PDFs need a different connector.

Why do some tables merge into one column?

Merged or spanned cells in the source page do not map to columns and rows cleanly. Fix it in the editor by splitting the column, or prefer a source with a proper table.

Is scraping a site always allowed?

Not necessarily. Check the site's terms of use and any copyright or licensing statements before pulling content into your own file, especially for commercial or personal data.

Can Power Query follow links inside the page?

It can extract link addresses as text, but it does not automatically crawl and open every link. Doing that requires building additional steps, and is usually better replaced by an official data source.