Retrieving web content
In the last section, we covered accessing data within files stored on a local computer or network file system. However, another common source of data is the internet. The standard M library includes a number of functions for retrieving data from the internet, including:
Web.BrowserContents
Html.Table
Web.Page
Web.Contents
Web.Headers
WebAction.Request
To see these functions in action, first perform these steps:
- Select Get Data from the Home tab of the Power Query editor and then choose Web.
- In the From Web dialog, use the following for the URL, https://subscription.packtpub.com/search.
- Press the OK button.
- Select Anonymous authentication and press the Connect button.
- In the Navigator dialog, choose HTML Code under the Text folder.
Following these steps generates the following M code as viewed in the Advanced Editor:
let
#"HTML Code" = Web.BrowserContents...