robhowley / nhlscrapi

Python based web scraper API for NHL game data
Apache License 2.0
69 stars 28 forks source link

Player first names in EventSummary contain leading space #13

Closed brianmxwll closed 8 years ago

brianmxwll commented 8 years ago

Using the example code from the main "Usage Example" with any game chosen, run the following code:

for jersey_num in game.event_summary.home_players:
    skater = game.event_summary.home_players[jersey_num]
    if skater['name']['first'][0] == ' ':
        print skater['name']

Which will print any skaters on the home team with a leading space in their first name.

Example results (2015-16 season, GameNum 1):

{'last': 'ARCOBELLO', 'first': ' MARK'}
{'last': 'HUNWICK', 'first': ' MATT'}
{'last': 'PHANEUF', 'first': ' DION'}
{'last': 'HARRINGTON', 'first': ' SCOTT'}
{'last': 'GARDINER', 'first': ' JAKE'}
{'last': 'BOZAK', 'first': ' TYLER'}
{'last': 'KADRI', 'first': ' NAZEM'}