Web.Page

Accessing Data

Returns the contents of an HTML document parsed into a table of tables, extracting all HTML tables found on the page.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Web.Page(webPage as any) as table

Parameters

NameTypeRequiredDescription
webPageanyYesThe HTML content to parse. Typically the result of Web.Contents, but can also be a text value containing raw HTML.

Return Value

tableA table where each row represents an HTML table or element found in the document, with a Data column containing the extracted table.

Remarks

Web.Page parses an HTML document and returns a navigation table listing every

element found in the document. It is the simplest way to extract tabular data from a web page — no CSS selectors or manual parsing required. Use Html.Table instead when you need to target non-table HTML structures or want column-level CSS selector control.

Input: The webPage parameter accepts the binary result of Web.Contents or a text string containing raw HTML. Power Query automatically handles decoding binary HTML using the encoding declared in the response headers or document.

Navigation table columns: Each row in the result represents one detected

element and includes: - Caption (text) — the table's
text, or an auto-generated name like "Table 0" if no caption is present. - Source (text) — a representation of the HTML context surrounding the table. - ClassName (text) — the class attribute of the element. - Id (text) — the id attribute of the
element. - Data (table) — the extracted table content. The first row is typically used as headers if the HTML uses
elements; otherwise use Table.PromoteHeaders.

Authentication: Web.Page does not make HTTP requests — it only parses HTML. Authentication is handled by Web.Contents or whichever function provides the HTML binary.

Limitations: - Web.Page is not available in Power BI Service for direct cloud refresh. It requires an on-premises data gateway for scheduled refresh. - JavaScript-rendered content is not executed. Tables dynamically loaded by JavaScript will not appear. Use Web.BrowserContents first, then pass the result to Web.Page. - A page may contain many incidental tables (menus, footers, ad containers). Inspect the result interactively in Power Query to identify the correct table by index, Caption, or Id.

Query folding: Not supported.

Examples

Example 1: Extract all tables from a web page

```powerquery

Web.Page(Web.Contents("https://en.wikipedia.org/wiki/List_of_countries_by_GDP"))

Example 2: Select the first table from a web page

```powerquery

let
    Source = Web.Page(Web.Contents("https://en.wikipedia.org/wiki/List_of_countries_by_GDP")),
    FirstTable = Source{0}[Data]
in
    FirstTable

Example 3: Find a specific table by its Id attribute

```powerquery

let
    Source = Web.Page(Web.Contents("https://example.com/data")),
    TargetTable = Source{[Id="sales-table"]}[Data]
in
    TargetTable

Example 4: Chain with Web.BrowserContents for JavaScript-rendered tables

```powerquery

let
    Html = Web.BrowserContents(
        "https://example.com/dynamic-page",
        [WaitFor = [Element = "table.results"]]
    ),
    Tables = Web.Page(Html),
    FirstTable = Tables{0}[Data]
in
    FirstTable

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks