Ratings Creation - Copying stats to spreadsheet problem

This forum is for league commissioners seeking advice when it comes to league related issues; rules, free agency system etc. / Ce forum devrait être utilisé par les commissaires qui cherches des conseils pour les aider à rouler leur ligue; règlements, systême agent libre etc.
Post Reply
Kramden23
The Addict / Le Drogué
Posts: 763
Joined: Tue May 13, 2008 8:33 pm

Ratings Creation - Copying stats to spreadsheet problem

Post 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?
Less than 1% of americans can speak french
More than 70% of canadians can speak english

Want more answers, why limit yourself? Post in english!
BRHL Hockey
The Passion One / Le Passionné
Posts: 245
Joined: Mon May 04, 2009 12:46 pm
Location: Denver, Colorado
Contact:

Re: Ratings Creation - Copying stats to spreadsheet problem

Post by BRHL Hockey »

Same problem

Had to switch where we gather stats from
Image
Bryce Shuck
[email protected]
The #1 source for STHS ratings since 2006!
BRHL $ League est. 2006 - http://new.brhl.net/
Cash Hockey, Football & Baseball Leagues
STHS, FHM7, OOTP, FanGm Platforms
gresh
The Passion One / Le Passionné
Posts: 202
Joined: Mon Aug 22, 2011 9:27 am
Contact:

Re: Ratings Creation - Copying stats to spreadsheet problem

Post 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).
SimonT
STHS Owner / Propriétaire du STHS
Posts: 14757
Joined: Sat Oct 08, 2005 4:18 pm
Location: Montreal, Canada
Contact:

Re: Ratings Creation - Copying stats to spreadsheet problem

Post 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.
-SimonT
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français
Germ Ant
New in Town / Le Ptit Nouveau
Posts: 3
Joined: Thu Jun 07, 2018 7:30 pm
Contact:

Re: Ratings Creation - Copying stats to spreadsheet problem

Post 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
Post Reply