Power Query Problems

How to Import Data from a JavaScript Web Page using Excel Power Query

Ayan MasoodAyan Masood Oct 26, 2026 869 views

Question details

The user wants to import specific dynamically loaded data (e.g., 8-16 day weather forecast) from a website into Excel via Power Query, but the data is rendered via a JavaScript postback instead of being accessible through a direct URL.

How to Import Data from a JavaScript Web Page using Excel Power Query
Product
Excel Power Query
Device & OS
not provided
Scenario
Importing a data table from a web page where the target content requires JavaScript execution or specific form parameters to load, preventing the standard From Web connector from scraping the desired output.
Observed behavior
The default web URL only imports the initial page state (e.g., 0-7 days) because Power Query does not execute the JavaScript postback required to reveal the extended data.
Before you start

Before attempting the import, verify the exact URL of the target web page and check if the site offers a dedicated API, which is often a more reliable method for extracting data than scraping JavaScript-rendered pages.

Solution 1Recommended

Use the Standard Power Query 'From Web' Connector

This is the primary method to fetch basic HTML tables from a URL when complex JavaScript navigation is not strictly blocking the table container.

If the data is embedded in the initial HTML or accessible via a specific query string, the standard 'From Web' feature can pull the table directly.

1
Open the Get Data menu

In Excel, navigate to the 'Data' tab on the ribbon, click 'Get Data', hover over 'From Other Sources', and select 'From Web'.

2
Enter the URL

Paste the target webpage URL into the dialog box and click 'OK'. Wait for Excel to connect to the site.

3
Select the required table

In the Navigator window, browse through the displayed tables. Check the box next to the table containing your desired data.

4
Transform and Load

Click 'Transform Data' to open the Power Query Editor. Here, you can clean the data, such as removing text units like 'C' or 'MPH' to ensure the columns are numeric. Once clean, click 'Close & Load' to bring the data into your spreadsheet.

Use the Standard Power Query 'From Web' Connector
Data Refresh: You can refresh the query at any time by right-clicking the loaded table in Excel and selecting 'Refresh'.
Free Microsoft Office alternative

Process and Analyze Your Data Effortlessly with WPS Office

While handling complex JavaScript web scraping may require advanced technical workarounds in Excel, managing and analyzing your successfully extracted data is a breeze with WPS Office. Enjoy a lightweight, highly compatible spreadsheet editor tailored for seamless data formatting and analysis.

  1. 1. Download and Install: Visit the official WPS Office website to download the free suite and install it on your device.
  2. 2. Import Your Data: Launch WPS Spreadsheet and easily open your .xlsx or .csv data files containing your web-scraped data.
  3. 3. Analyze and Format: Use built-in data transformation tools, charts, and pivot features to analyze your extracted datasets efficiently.
Fully compatible with Microsoft Excel file formats including .xlsx, .xls, and .csv.Comprehensive suite of data analysis tools, including PivotTables and advanced formulas.Lightweight design ensuring fast performance on Windows, Mac, and Linux.A highly familiar, easy-to-use interface that requires zero learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Power Query not display the data I see on my screen?

The Power Query 'From Web' tool retrieves the initial HTML code sent by the server. If the data you see is rendered dynamically by JavaScript after the page has loaded, Power Query cannot natively execute that script, resulting in missing or default tables.

How do I remove text characters like 'C' or 'MPH' from my imported numbers?

In the Power Query Editor, select the column containing the units, right-click, and choose 'Replace Values' to replace the text with nothing, or use 'Split Column' by non-digit characters. This allows you to change the column data type to a numeric format for analysis.

Can I automate the retrieval of data hidden behind a postback?

Yes, but it requires using the Advanced Editor in Power Query to write custom M-code. You will need to use the Web.Contents function to supply the exact HTTP headers and POST payload that the website's server expects.