• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

WebSite single URL multiple table pages, how to download all pages?

Status
Not open for further replies.
Hi,

I am trying to download Fifa Mens ranking from the website "https://www.fifa.com/fifa-world-ranking/ranking-table/men/#all". The ranking table contains 5 pages where the first page shows the first 50 rankings. All the pages have the same URL stated above.

I am trying to import these pages into excel via power query but get only the first page because all the pages has the same URL. I am wondering if there is possible to import all the rankings to power query or some method to figure out the URL to the other 4 pages?

Regards
Lars Ole
 

Attachments

  • WebSite single URL multiple table pages power query import.xlsx
    19.7 KB · Views: 10
Since site has control/script that slices data within page (i.e. all data is present in underlying html, but not in Page content). You will need to remove that portion or extract out table element from responsetext.

So... don't rely on using Web.Page() from Web.Content. But Text.FromBinary() to return text. Then use text manipulation to extract out the portion that's needed. Then use Web.Page() to parse specific element.

Ex:
Code:
let
    Source = Text.FromBinary(Web.Contents("https://www.fifa.com/fifa-world-ranking/ranking-table/men/")),
    tableTxt = "<table" & Text.Split(Text.Split(Source, "<table"){1}, "</table>"){0} & "</table>",
    tableObj = Web.Page(tableTxt),
    Data = tableObj{0}[Data],
    #"Changed Type" = Table.TransformColumnTypes(Data,{{"Rnk", Int64.Type}, {"Team Team", type text}, {"Total Points PTS", Int64.Type}, {"Previous Points Prev.Pts", Int64.Type}, {"+/-", Int64.Type}, {"Positions Pos", type text}, {"Confederations fifa_TBT", type text}})
in
    #"Changed Type"
 
Last edited:
nxy
As You've read from Forum Rules
You should open a new thread.
 
Status
Not open for further replies.
Back
Top