Scraping Amazon product information

In this lesson, I’m going to fetch data from amazon. However in the future we will cover this example in depth, and I will teach you how to use the  M formula language and how to create function to be able to view the page in a dynamic manner.

First, let’s run power bi and click the get data button, here you can view data source list which provides many options to choose from, for instance: excel, pdf, and Facebook,…

In this example we select web.
Get web Data Power BI

We paste an amazon link , that was copied from the browser now we patiently wait until the data is fetched.

https://www.amazon.com/s?i=specialty-aps&bbn=16225007011&rh=n%3A16225007011%2Cn%3A1292110011&ref=nav_em__nav_desktop_sa_intl_data_storage_0_2_6_5

You can view that power bi has extracted two tables .

Sample Data From Amazon

Let’s go over and see what is in those tables.

So neither of these data satisfies us. They are irrelevant.

By the add table using button , we are able to customize our table via/through CSS class.

Ok let’s see how we can fetch data using this method.

On the amazon web page, right-click on an element, in this step it’s the title, then click inspect and then select the needed values which we will need to paste to power bi, from here, you can see that power BI automatically fills the rest of the columns with the rest of your needed values.

Add Table Using Example

and then

Add Table Using Example

Now let’s go over and insert the prices, again we right click on the price and then inspect, copy paste the values into power bi.

Do the same for the images and ranking.
Amazon Web Scarping

Look ! that’s great isn’t it. And plus we haven’t even reached the transformation yet.

So, click the ok button, the data in amazon is clean enough, we don’t need to transform the data.

We wait until all of the data is fetched, then we drag and drop a table on the screen , and then we insert the desired fields.

Amazon Data Table

You can view your table but the images aren’t the way we want them to be.

In order to fix this, select the image field, then go to column tools, and then change the data category to image URL. Now you can view the images properly.
Image Data Category

I wish that, this example was interesting and useful.

Amazon Power BI Sample

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *