FranGoitia / basketball_reference

Basketball Reference Scraper
98 stars 45 forks source link

IndexError w/ current season #5

Open dlman opened 7 years ago

dlman commented 7 years ago

When trying to run with the current season:

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 "/Users/dl/nba/basketball_reference/base.py", line 333, in crawl_season
    self._gen_matches_codes()
  File "/Users/dl/nba/basketball_reference/nba.py", line 120, in _gen_matches_codes
    self._gen_month_codes(url)
  File "/Users/dl/nba/basketball_reference/nba.py", line 129, in _gen_month_codes
    reg_season, post_season = seasons[0], None
IndexError: list index out of range
wildbill9188 commented 6 years ago

I'm encountering the same issue for this season. Did you ever identify/resolve the issue?

Cavalic commented 6 years ago

Was there ever any resolution for this problem?

wildbill9188 commented 6 years ago

Similar to the issue raised w the 2011-2012 lockout season, you need to change the months in the nba.py file (line 117) to reflect those in which games have actually been played this season. My method at least