Downloads
Power Query MData sourcesIntermediate

Web.Page

Reads an HTML web page and returns the tables it contains, so you can pick the one you need.

Syntax
Web.Page(html)

Returns: A table with a row for each table on the page. Its Data column holds each table's rows.

What it does

Web.Page reads an HTML page and finds the tables in it. It is useful for a public table that has no download, such as a published rate schedule or a list of holidays. The page is read as it is, so the query works until the page layout changes.

Syntax and arguments

Example

A published table of standard mileage rates appears on a web page. The query reads the page and takes the first table on it.

let
    Source = Web.Page(Web.Contents("https://www.example.com/mileage-rates")),
    Tables = Source{0}[Data],
    WithHeaders = Table.PromoteHeaders(Tables, [PromoteAllScalars = true])
in
    WithHeaders

Source has one row per table on the page, so {0}[Data] takes the first table's rows. The headers are promoted from the first row. The address is a placeholder.

Example: a second, different use

Choosing the table by its position in a list of tables after a quick check of the page. Look at the Source table in the editor to see which row holds the table you need.

Things to watch

In business terms

Published rate tables, fee schedules and public reference data are sometimes only on a web page. Keep a dated copy of what you pulled, because a page can change after the figures were used.

Related functions

All Power Query M functions · View as Markdown · M basics