cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

How to load Data from a webpage having multiple pages

Hello,

 

I am trying to import data using the below query , But I am able to import only the first 30rows in table0..How do I loop to the next table and import the remaing?

 

Please suggest necessary changes to the 'M' code

 

URL: http://www.moneycontrol.com/markets/earnings/latest-results/latest/yoy/standalone/

 

let
    Source = Web.Page(Web.Contents("http://www.moneycontrol.com/markets/earnings/latest-results/latest/yoy/standalone/")),
    Data0 = Source{0}[Data],
    #"Changed Type" = Table.TransformColumnTypes(Data0,{{"Company Name", type text}, {"Sales (Rs Crore) Dec 2016", type number}, {"Sales (Rs Crore) Dec 2015", type number}, {"Sales (Rs Crore) % Chg", type text}, {"Gross Profit (Rs Crore) Dec 2016", type number}, {"Gross Profit (Rs Crore) Dec 2015", type number}, {"Gross Profit (Rs Crore) % Chg", type text}, {"Net Profit (Rs Crore) Dec 2016", type number}, {"Net Profit (Rs Crore) Dec 2015", type number}, {"Net Profit (Rs Crore) % Chg", type text}})
in
    #"Changed Type"

Thank you.

8 REPLIES 8
Highlighted
Microsoft
Microsoft

Re: How to load Data from a webpage having multiple pages

This looks like it might be useful

 

http://blogs.adatis.co.uk/callumgreen/post/Loop-through-Multiple-Web-Pages-using-Power-Query


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Highlighted
Microsoft
Microsoft

Re: How to load Data from a webpage having multiple pages

This is also worth reading.


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Highlighted
New Member

Re: How to load Data from a webpage having multiple pages

Thank you

 

I have no knowledge about the parameters in the URL.

 

Could you please let me know how to identify the variable so that I could loop through all the sheets and get the data using power query.

Highlighted
Community Support
Community Support

Re: How to load Data from a webpage having multiple pages

Hi @queryfan,

 

You can't just use the site URL to get table data in desktop simply. You need to view corresponding API and find the actual URL to get all table data. So the first thing you need to do is contacting Money Control to find the rest API to get data. Then you can follow this simple to do it in desktop: How to call REST APIs and parse JSON with Power BI

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Advocate II
Advocate II

Re: How to load Data from a webpage having multiple pages

Hi! I have the same situation as you.  Were you able to find a way to get all the pages? Parameterizing the query won't work for our scenario because the URL doesn't have the page number.  In fact, it doesn't change when we switch page by clicking the other page numbers at the bottom.

 

 

Regards,

 

Ferdinand

Highlighted
Helper I
Helper I

Re: How to load Data from a webpage having multiple pages

Hello @ferdsjoseph,

 

I am running into the same dilemma as you are.

 

Have you had any luck finding help with this issue?

 

Please let me know. Thanks.

 

-K

Highlighted
Advocate II
Advocate II

Re: How to load Data from a webpage having multiple pages

Hello @kmuralid,

 

Sorry I wasn't able to find a solution.  I ended up just settling for getting just the data on the default page (first page).  Just to clarify, the issue is not being able to get additional pages from a URL if the webpage uses javascript for pagination because the URL remains the same even if you navigate the table to next pages.

 

 

Regards,

 

Ferdinand

Highlighted
Helper I
Helper I

Re: How to load Data from a webpage having multiple pages

Gotcha. Yes, that was the issue I had in mind as well.

 

Thanks for getting back.

 

-K

Helpful resources

Announcements
Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors