You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting an error with responses from the overview function:
from mlbgame import games, box_score, overview
this = games(2019, 5, 1, home='Phillies')
game_id = this[0][0].game_id
ovr = overview(game_id)
produces:
raw_box_score_root = etree.parse(raw_box_score).getroot()
File "src/lxml/etree.pyx", line 3435, in lxml.etree.parse
File "src/lxml/parser.pxi", line 1861, in lxml.etree._parseDocument
File "src/lxml/parser.pxi", line 1881, in lxml.etree._parseFilelikeDocument
File "src/lxml/parser.pxi", line 1776, in lxml.etree._parseDocFromFilelike
File "src/lxml/parser.pxi", line 1187, in lxml.etree._BaseParser._parseDocFromFilelike
File "src/lxml/parser.pxi", line 601, in lxml.etree._ParserContext._handleParseResultDoc
File "src/lxml/parser.pxi", line 711, in lxml.etree._handleParseResult
File "src/lxml/parser.pxi", line 640, in lxml.etree._raiseParseError
File "http://gd2.mlb.com/components/game/mlb/year_2019/month_05/day_01/gid_2019_05_01_detmlb_phimlb_1/rawboxscore.xml", line 1
lxml.etree.XMLSyntaxError: Space required after the Public Identifier, line 1, column 55
I dug around a bit and imported mlbgame.data.get_overview to see what was up:
from mlbgame.data import get_overview
import lxml.etree as etree
ovr = get_overview(game_id)
print(ovr.url)
print(ovr.read())
I think the library has been having a lot of issues recently because of the new Stats API. Since the new API is JSON, it is a lot easier to work with in python than XML (the reason I created this library), and I would suggest using that directly.
Getting an error with responses from the
overview
function:produces:
I dug around a bit and imported
mlbgame.data.get_overview
to see what was up:Which produces this output:
Thought the notice at the beginning should be brought to your attention
The text was updated successfully, but these errors were encountered: