logo
search
Power Query Problems

How to Fix Power Query Returning HTML Instead of Structured Web Data

Olivia MillerOlivia Miller Oct 1, 2026 868 views

Question details

The user wants to extract structured data from a website, but Power Query fails to parse it properly, returning an HTML table in the Children property and a null value in the Text property.

How to Extract Structured Web Data When Power Query Returns HTML
Product
Excel Power Query
Device & OS
not provided
Scenario
Importing data from a web URL using Power Query.
Observed behavior
Power Query does not recognize the web page data as a standard table, resulting in raw HTML being returned in the Children property while the expected text returns null.
Before you start

Before troubleshooting, open the target URL in a standard web browser to verify if the data is rendered dynamically via JavaScript, as the standard Power Query Web connector only parses static HTML content.

Solution 1Recommended

Use the Html.Table Function in Power Query

Use the advanced Html.Table M function to manually parse the raw HTML string by targeting specific CSS selectors.

When the standard web connector fails to recognize tables, the underlying data often resides inside complex div structures or non-standard HTML elements. By using the Html.Table function, you can explicitly define which HTML tags or classes contain your data.

1
Open Power Query Editor

Navigate to the query that returns the raw HTML. Select 'Add Column' from the top ribbon and click on 'Custom Column'.

2
Write the Html.Table formula

In the Custom Column dialog, enter the formula: Html.Table([ColumnName], {{"ExtractedData", "YOUR_CSS_SELECTOR"}}). Replace [ColumnName] with the column containing the HTML, and YOUR_CSS_SELECTOR with the actual HTML tag or class you need to extract.

3
Expand the custom column

Click the expand icon on the header of your newly created custom column to view the structured data that has been parsed from the HTML.

4
Load the data

Remove the original column containing the raw HTML to clean up your dataset, then click 'Close & Load' to bring the structured data into Excel.

Use the Html.Table Function in Power Query
Identifying CSS Selectors: You can find the correct CSS selector by opening the target webpage in your browser, pressing F12 to open Developer Tools, and inspecting the element containing your data.
Free Microsoft Office alternative

Try WPS Office for Your Data Processing Needs

If you find Microsoft Excel's Power Query web extraction overly complex or difficult to troubleshoot, consider trying WPS Office. It provides a lightweight, highly compatible alternative with intuitive tools for everyday data analysis, filtering, and formatting without the steep learning curve.

  1. 1. Download and install: Download WPS Office for free from the official website and complete the installation process.
  2. 2. Open your dataset: Launch WPS Spreadsheet and easily open your existing Excel files or CSV data exports.
  3. 3. Process your data: Navigate to the Data tab to utilize intuitive tools for sorting, filtering, and structuring your information without needing complex code.
Highly compatible with Microsoft Excel (.xlsx, .xls, .csv) formats.Free and lightweight, avoiding heavy system resource usage during data processing.Familiar spreadsheet interface for seamless migration and quick data handling.Built-in tools for easy data filtering, sorting, and basic data imports.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Power Query return null text when importing from the web?

This typically occurs when the target webpage loads its data dynamically using JavaScript. Power Query's basic web connector only downloads the initial static HTML, meaning dynamically rendered text elements will appear as null.

What is the difference between getting web data in Excel vs. Power BI?

While both applications use Power Query, Power BI Desktop often receives feature updates to its web connector faster than Excel. This includes better background support for inferring complex web tables and a more robust 'Extract table using examples' feature.

How do I find the correct CSS selector for the Html.Table function?

Open the webpage in your browser, right-click the specific data element, and select 'Inspect'. This opens Developer Tools where you can view the HTML tags (like <table> or <div>) and their class names, which you then format as a CSS selector string in your query.

Can Power Query extract data from a website that requires a login?

Yes, but you must configure the credentials properly. Go to Data Source Settings, select your web URL, edit the permissions, and enter your Web or Basic authentication details. Keep in mind that modern sites using complex token-based logins may require an API approach instead of standard web scraping.