In this Valentine blog I will inspire you on 'Data Scraping' within Power BI and how to embed this afterwards into a Microsoft PowerApps Canvas App or mobile application.
But first let's talk about what 'Data Scraping' means. When looking at a definition it's considered as being a technique where a computer program (I.e. MS Power BI) will extract data from output generated from another program.
In this example we will be using the 'Web Scraping' technique in order to scrape existing output data from an e-commerce webshop.
Scraping pralines
As you all know I love making chocolates and my own pralines and bring it to life in our virtual company 'The Chocolate Company'. So why not scraping off some chocolates data in this example. First you will have to navigate to the site where you want to take some data from.
As being one of the finest Belgian Chocolates vendor I've taken 'Van Dender' as example. I found following E-shop on their website: WEBSHOP - Van Dender - Chocolate, pralines and more.
Looking great no? Make sure you have some structured data residing on the website. In this case pralines or chocolate products with some prices, description,...
Open now your Microsoft Power BI Desktop application. Search for the 'Get data' option and select Web as the data source.
Copy paste the chosen URL from the E-shop and make sure that the root part is saved as being one of your trusted site.
Great we get following suggested tables back. We will be using the 'Add Table Using Examples' functionality. By doing so we will have to possibility to pick the data we want.
Scroll down to the first data attribute that you want to scrape. Position yourself in the first cel and type it. In my example this will be 'Bag of Brasil...'.
Next populate some other products in your first column. When having entered some 5 records , Power BI will populate the rest of the data.
Repeat the same steps for having the prices populated in the 2nd column. Use the '+' sign to add some column. Below you will find the result.
Afterwards click 'Ok' and you will see that a custom table with name 'Table 12' has been created. Let's transform the data by clicking on the 'Transform Data' button.
As you know when being a 'Power BI Lover' (it's Valentine right?) we will have the data visible in our 'Power Query Editor'. We will change the name to 'Van Dender Chocolates'. We also used the 'Column From Examples' in order to have a custom column with the weight of the products.
And we will perform the same action for retrieving the price from the prices incl vat column. Click on the 'Close & Apply' to have it applied. The data is being loaded into the model. We'll make some nice visuals for it and we push the data into the cloud.
Finally we will create our 'Canvas App' in PowerApps in order to have our report directly in our mobile application. Open your Canvas App 'Studio' in PowerApps and embed the Power BI tile.
And data showing in our mobile app, competitor data at your fingertips by combining Data Web Scraping into your reports.
Competitor info analysis
From a business perspective you could use the Data Scraping functionality in Power BI to enrich your data model with some web based information. Retrieving data from your competitors and perform some insights analysis on it.
Happy Valentine folks!
Comments