Power Query (web page to Excel) - when there is no table?

GabrielAIK

New Member
Joined
Apr 23, 2018
Messages
20
Hi,

I would like to fetch data from an Internet page to Excel, but the problem is that the web page in question does not have a table that is importable.

Is it still possible to fetch the data, or is there no hope?

I'd like to fetch information from a website called Avanza.

E.g. this stock: https://www.avanza.se/aktier/om-aktien.html/82987/nokia-oyj

If you scroll down you see something called "Mäklarstatistik" (Broker statistics). I want to sort this by "Köpt" and then fetch the top 5 rows to Excel.

Is this possible?

Thanks!
 
Do you have a Get & Transform section on the Data tab?

Or a New Query button?
 
Upvote 0

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Do you have a Get & Transform section on the Data tab?

Or a New Query button?

Oh!

I had just went from Data straight to pressing "From Web"

But there is also an alternative route, going from Data -> New Query -> From other sources -> Web

There, I enter the URL, select the "Basic" version then press "OK".

Then it connects to the site, and thereafter there is a Navigator window that pops up.

To the left, under "Display Options", I can see all the tables.

As you said, Table 0 is the one I was looking for. So I simply pressed on it, and then on the "Load" button, and it was sent to Excel.

Now, I'm wondering, is it possible to automatically sort it from largest to smallest under column C ("Köpt")?

Or do I need to update Excel sheet using alt+A+R+A

And then manually select the numbers shown in Column C and sort from Largest to smallest?
 
Last edited:
Upvote 0
Not sure what you mean, in the Power Query editor you can sort the Köpt using the arrow next to the header and you can do the same when you return the table to Excel.
 
Upvote 0
Not sure what you mean, in the Power Query editor you can sort the Köpt using the arrow next to the header and you can do the same when you return the table to Excel.

I see, I opened the Query editor, and under "Köpt" I wanted to sort it by Descending to get the highest values at the top.

However, the website uses a spacing which the Query Editor doesn't recognize. Is is possible to fix this in some way?

Like transforming all " " to "", enabling it to sort the numbers?
 
Last edited:
Upvote 0
So what should a value like 9 521 be?

Is it 9,521?

Also, in the other columns should 5071 actually be 50.71 (50,71)?
 
Upvote 0
So what should a value like 9 521 be?

Is it 9,521?

Also, in the other columns should 5071 actually be 50.71 (50,71)?

Yes exactly!

I received some help yesterday on the forum regarding this matter, using substitution formulas, e.g.: =IFERROR(SUBSTITUTE(SUBSTITUTE(W48,",",".")," ","")+0,"-")
 
Upvote 0
In Power query select all the columns except Mäklare.

Right click one of the columns and select Change Type>Using Locale.

In the Change Type with Locale select a suitable data type, e.g. Currency, Decimal Number, from the first drop down.

In the Locale drop down select the relevant locale, which I think is Swedish (Sweden).

Click OK.

You should now have a table with sortable columns.
 
Last edited:
Upvote 0
In Power query select all the columns except Mäklare.

Right click one of the columns and select Change Type>Using Locale.

In the Change Type with Locale select a suitable data type, e.g. Currency, Decimal Number, from the first drop down.

In the Locale drop down select the relevant locale, which I think is Swedish (Sweden).

Click OK.

You should now have a table with sortable columns.

Thank you very much!!

I chose Decimal numbers for the share prices, and then "Whole numbers" for the volumes which seems to solve the problem.

I'll give it a try tonight when I need to update my Excel sheet.

Thank you very much for your patience and help, appreciate it a lot!
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,195
Members
453,021
Latest member
pingpong7117

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top