Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

tharunkumarRTK

Do Not Use Web.BrowserContents (1/2)

Extracting or scraping data from publicly accessible websites is not difficult in Power BI Desktop thanks to its web connector. 

tharunkumarRTK_0-1754835387022.png

 

let 
 Source = Web.BrowserContents( 
   "https://www.worldometers.info/world-population/population-by-country/
 ) 
in 
Source  

 

If you've noticed Html.Tables being used as well, you might wonder why. The answer is simple: the output of Web.BrowserContents isn't directly a table or a readable value—it’s a binary value. You need to convert this binary data into something readable, which is where parsing functions come in. That’s why, when you’re pulling data from an API, along with Web.Contents function, functions like Json.Document, Xml.Document, or Csv.Document are invoked depending on the endpoint's data format. Similarly, data from Excel files located in Sharepoint folder will use Excel.Workbook(). 

 

Why Is Html.Tables Needed? 

Let’s break this down. Suppose the URL you provided isn’t an Excel file on SharePoint or an API endpoint, but just a publicly accessible webpage. The data is available right on the page itself, which is — naturally — in HTML format. To present tabular data in HTML, developers often use the <table> tag. So, when you use a web URL as a source in Power BI Desktop, it’s intelligence identifies the output format and automatically applies the necessary parsing functions to present your data. If the site contains multiple tables (multiple <table> tags), the navigation pane displays all of them, allowing you to choose which table you want to import. 

Since this data is publicly accessible, anonymous authentication works, and you can refresh the data from the Power BI Service.  

 

In my next blog I will continue the discussion on this topic where I will explain a practical scenario