frangoitia / basketball_reference Goto Github PK
View Code? Open in Web Editor NEWBasketball Reference Scraper
Basketball Reference Scraper
After cloning, installing all the modules from requirements and trying out the first example:
(venv) dl-MacBook-Pro:basketball_reference dl$ python match_generator.py --league nba --seasons 2003-2004
Traceback (most recent call last):
File "match_generator.py", line 7, in <module>
from nba import NbaBRefSeason
File "/Users/dl/nba/basketball_reference/nba.py", line 6, in <module>
from base import BRefMatch, BRefSeason
File "/Users/dl/nba/basketball_reference/base.py", line 78
SyntaxError: Non-ASCII character '\xe2' in file /Users/dl/nba/basketball_reference/base.py on line 78, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
Should maybe include encoding at top of base.py?
hi
great package
what version of Python is this for? i get the following error.
Traceback (most recent call last):
File "match_generator.py", line 3, in <module>
raise('Must be run in Python 3')
TypeError: exceptions must be old-style classes or derived from BaseException, not str
The code that caused this warning is on line 49 of the file match_generator.py. To get rid of this warning, change code that looks like this:
BeautifulSoup([your markup])
to this:
BeautifulSoup([your markup], "html.parser")
markup_type=markup_type))
Traceback (most recent call last):
File "match_generator.py", line 49, in <module>
b_ref.crawl_season()
File "xxx/base.py", line 328, in crawl_season
self._gen_matches_codes()
File "xxx/nba.py", line 137, in _gen_matches_codes
reg_season, post_season = seasons[0], None
IndexError: list index out of range
Two strings are not covered on line 49: 'Not With Team', 'Did Not Dress', that line needs to be modified to:
stat = stat if stat not in [None, 'Did Not Play', 'Not With Team', 'Did Not Dress', 'Player Suspended'] else '0.0'
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
\GitHub\basketball_reference>python match_generator.py --league nba --seasons 2003-to-2017
Traceback (most recent call last):
File "match_generator.py", line 7, in
from nba import NbaBRefSeason
File "C:\Users\Bill\Documents\GitHub\basketball_reference\nba.py", line 6, in
from base import BRefMatch, BRefSeason
File "C:\Users\Bill\Documents\GitHub\basketball_reference\base.py", line 21, in
signal.signal(signal.SIGALRM, timeout_handler)
AttributeError: module 'signal' has no attribute 'SIGALRM'
I looked and it seems like I'm not the first person to run into this issue, but perhaps the first to run into it on this specific project. I found a fix for the same error on a similar project ( Unity-Technologies/ml-agents@4958f04 ) but I'm struggling to implement the work-around here.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.