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:
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:
Has anyone else encountered the same problem and/or have you found a solution?
Ratings Creation - Copying stats to spreadsheet problem
Ratings Creation - Copying stats to spreadsheet problem
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!
More than 70% of canadians can speak english
Want more answers, why limit yourself? Post in english!
-
- The Passion One / Le Passionné
- Posts: 246
- Joined: Mon May 04, 2009 12:46 pm
- Location: Denver, Colorado
- Contact:
Re: Ratings Creation - Copying stats to spreadsheet problem
Same problem
Had to switch where we gather stats from
Had to switch where we gather stats from
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
Re: Ratings Creation - Copying stats to spreadsheet problem
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).
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).
-
- STHS Owner / Propriétaire du STHS
- Posts: 14785
- Joined: Sat Oct 08, 2005 4:18 pm
- Location: Montreal, Canada
- Contact:
Re: Ratings Creation - Copying stats to spreadsheet problem
PowerShell is the answer.
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.
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
-SimonT
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français
Re: Ratings Creation - Copying stats to spreadsheet problem
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
Very simple - just an added few steps.
Trevor