Page 1 of 1

power Query Premierleague.com

Posted: Fri Dec 21, 2018 11:25 pm
by mickyflash1982
Hello. I am a football Stats man, and I have been trying to run a PowerQuery using my very limited knowledge with even more limited success!

For example on this page : https://www.premierleague.com/stats/...s/goals?se=210 I am looking for this information here:
Image

It is struggling to find any tables and when it does it will only pull up the 20 rows showing on the page, and I am looking for the information from all the pages using the Next page delimiter OR gives me the top all time scorers rather than this current season.

PremierLeague.com have an array of information available and I would like to gather all of these stats in my spreadsheet so I can analyse performance
Image

I am well out of my depth and this community has been very helpful in the past so I wonder if anyone can help?

Re: power Query Premierleague.com

Posted: Sat Dec 22, 2018 1:09 am
by mickyflash1982
UPDATE:

OK, I can work around recieving the all time data rather than the current season. Ive managed to find tables for all of the stats. My biggest issue is only loading the 20 rows shown on the page rather than the full results.

Image
the next page icon highlighted above does not change the url, is there any way round this? help would be graetly appreciated

Re: power Query Premierleague.com

Posted: Sat Dec 22, 2018 6:53 am
by MattAllington
The link you posted doesn't work. Can you post the link you are using?

Re: power Query Premierleague.com

Posted: Sat Dec 22, 2018 2:25 pm
by mickyflash1982

Re: power Query Premierleague.com

Posted: Sat Dec 22, 2018 10:26 pm
by mickyflash1982
here is the code for the query

{L_CODE}{L_COLON} {L_SELECT_ALL_CODE}

let
    Source = Web.Page(Web.Contents("https://www.premierleague.com/stats/top/players/goals")),
    Data0 = Source{0}[Data],
    #"Changed Type" = Table.TransformColumnTypes(Data0,{{"Rank", Int64.Type}, {"Player", type text}, {"Club", type text}, {"Nationality", type text}, {"Stat", Int64.Type}})
in
    #"Changed Type"

Re: power Query Premierleague.com

Posted: Sun Dec 23, 2018 6:18 am
by MattAllington
OK. I don't know of any way to solve this problem with Power Query. The website seems to be using javascript to send a query to their DB and return the data into the page. This is not something that Power Query can do unfortunately.