FranGoitia / basketball_reference

Basketball Reference Scraper
98 stars 45 forks source link

Error for season 2011-2012 #6

Open nicofisch5 opened 7 years ago

nicofisch5 commented 7 years ago

Hi Francisco,

When I launch the following command: python match_generator.py --league nba --seasons 2011-2012

I get the following error:

Traceback (most recent call last):
  File "match_generator.py", line 31, in <module>
    main(args.league, args.seasons)
  File "match_generator.py", line 22, in main
    b_ref.crawl_season()
  File "/var/www/basketball_reference/base.py", line 332, in crawl_season
    self._gen_matches_codes()
  File "/var/www/basketball_reference/nba.py", line 120, in _gen_matches_codes
    self._gen_month_codes(url)
  File "/var/www/basketball_reference/nba.py", line 129, in _gen_month_codes
    reg_season, post_season = seasons[0], None
IndexError: list index out of range

I guess it is because of the lockout.

Thanks for your work. Nicolas

wildbill9188 commented 6 years ago

Just change the months in the nab.py file (line 117) to reflect those in which games were actually played. This is probably causing the current-season issue someone else raised.