Page 1 of 1

Ratings Creation - Copying stats to spreadsheet problem

Posted: Fri May 11, 2018 9:09 pm
by Kramden23
Every year when we make new ratings for our league I simply copied the stats table from nhl.com and pasted them in an excel sheet. For years this worked perfectly and placed all the stats correctly in separate cells.

Photo Example:
Image


However this year when I copy/paste the stats in excel they are getting pasted vertically and not in the cells they're supposed to.

Photo Example:
Image


Has anyone else encountered the same problem and/or have you found a solution?

Re: Ratings Creation - Copying stats to spreadsheet problem

Posted: Sun May 13, 2018 10:59 am
by BRHL Hockey
Same problem

Had to switch where we gather stats from

Re: Ratings Creation - Copying stats to spreadsheet problem

Posted: Mon May 14, 2018 11:53 am
by gresh
On my side, I'm not using the stats page, I'm using the API.

Like this one:
http://www.nhl.com/stats/rest/skaters?i ... mary&sort=[{%22property%22:%22points%22,%22direction%22:%22DESC%22},{%22property%22:%22goals%22,%22direction%22:%22DESC%22},{%22property%22:%22assists%22,%22direction%22:%22DESC%22}]&cayenneExp=gameTypeId=3%20and%20seasonId%3E=20172018%20and%20seasonId%3C=20172018

In PHP, it's easy to extract.

To know the API to use, use Chrome, go a NHL.com stats page, press F12, press F5 to refresh the page and search for the API call (this is the tricky part).

Re: Ratings Creation - Copying stats to spreadsheet problem

Posted: Tue May 15, 2018 6:54 pm
by SimonT
PowerShell is the answer.

Code: Select all

$JSON = Invoke-RestMethod -uri "http://www.nhl.com/stats/rest/skaters?isAggregate=false&reportType=basic&isGame=false&reportName=skatersummary&cayenneExp=gameTypeId=2 and seasonId%3E=20172018"
$Players = $JSON.Data
$Players | export-csv NHLData.csv -NoTypeInformation
P.S. For the futur user, please look at the first line for the season year / ID. Because you can also get previous year stat with this query.

Re: Ratings Creation - Copying stats to spreadsheet problem

Posted: Thu Jun 07, 2018 10:19 pm
by Germ Ant
Here's a potential solution - while at NHL.com, highlight the stats you want, go to print preview, highlight the stats in the print preview section, copy and paste into a word processor, replace all " " with tabs (using find and replace), highlight all, copy and paste into excel.

Very simple - just an added few steps.

Trevor