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.

5 REPLIES 5
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

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors