Giter Site home page Giter Site logo

XML about mlbgame HOT 14 CLOSED

panzarino avatar panzarino commented on July 28, 2024
XML

from mlbgame.

Comments (14)

panzarino avatar panzarino commented on July 28, 2024

@gman2691 can you please provide a direct example of where this occurs

from mlbgame.

gman2691 avatar gman2691 commented on July 28, 2024

The teaser code that you posted to find all of the scores in the Mets games.

from mlbgame.

panzarino avatar panzarino commented on July 28, 2024

@gman2691 I'm not getting any error, can you please post the error response you are getting?

from mlbgame.

jimluke827 avatar jimluke827 commented on July 28, 2024

I get this error lxml.etree.XMLSyntaxError: Start tag expected, '<' not found, line 1, column 1

from mlbgame.

jimluke827 avatar jimluke827 commented on July 28, 2024

full copy:

Traceback (most recent call last):
File "C:/......../main.py", line 5, in
month = mlbgame.games(2015, 6, home="Mets")
File "C:........._init_.py", line 205, in games
game = day(i, y, x, home=home, away=away)
File "C:.........._init_.py", line 175, in day
data = mlbgame.game.scoreboard(year, month, day, home=home, away=away)
File "C:.................\game.py", line 17, in scoreboard
parsed = etree.parse(data)
File "src\lxml\lxml.etree.pyx", line 3427, in lxml.etree.parse (src\lxml\lxml.etree.c:81101)
File "src\lxml\parser.pxi", line 1811, in lxml.etree._parseDocument (src\lxml\lxml.etree.c:117832)
File "src\lxml\parser.pxi", line 1837, in lxml.etree._parseDocumentFromURL (src\lxml\lxml.etree.c:118179)
File "src\lxml\parser.pxi", line 1741, in lxml.etree._parseDocFromFile (src\lxml\lxml.etree.c:117091)
File "src\lxml\parser.pxi", line 1138, in lxml.etree._BaseParser._parseDocFromFile (src\lxml\lxml.etree.c:111637)
File "src\lxml\parser.pxi", line 595, in lxml.etree._ParserContext._handleParseResultDoc (src\lxml\lxml.etree.c:105093)
File "src\lxml\parser.pxi", line 706, in lxml.etree._handleParseResult (src\lxml\lxml.etree.c:106801)
File "src\lxml\parser.pxi", line 635, in lxml.etree._raiseParseError (src\lxml\lxml.etree.c:105655)
File "file:/C:/.................../scoreboard.xml.gz", line 1
lxml.etree.XMLSyntaxError: Start tag expected, '<' not found, line 1, column 1

Process finished with exit code 1

from mlbgame.

panzarino avatar panzarino commented on July 28, 2024

@jimluke827 I'm not getting that error at all, it could be an issue with lxml. Can you try updating both mlbgame and lxml to the latest version?

from mlbgame.

jimluke827 avatar jimluke827 commented on July 28, 2024

@zachpanz88 I am at the latest version of each.

from mlbgame.

jimluke827 avatar jimluke827 commented on July 28, 2024

@zachpanz88 I was using Python 3, I used python 2 and had a ton of trouble getting libxml2 to install, but once I got that all set everything is working

@gman2691 see above if you are using wrong version of python

from mlbgame.

panzarino avatar panzarino commented on July 28, 2024

Again, I do not seem to get the error when I am testing with python 3.

File "file:/C:/.................../scoreboard.xml.gz", line 1

@jimluke827 Is there any way you could fill in part of that "......" so I can diagnose what day the information is coming from? I just need the "month_06/day_xx/" part.

Just to be clear, we are talking about this example, correct?

from __future__ import print_function
import mlbgame

month = mlbgame.games(2015, 6, home="Mets")
games = mlbgame.combine_games(month)
for game in games:
    print(game)

from mlbgame.

jimluke827 avatar jimluke827 commented on July 28, 2024

@zachpanz88 I don't have the error anymore, but I just used the exact examples that were shown in the readme, neither worked and both gave the same error.

from mlbgame.

panzarino avatar panzarino commented on July 28, 2024

@jimluke827 I noticed from your error messages that you are using Windows. I have been testing everything on Linux, which handles .gz files much better than Windows. The problem could have arisen from Windows not being able to handle the compressed files, so I'll run some tests on Windows.

from mlbgame.

rhoffer21 avatar rhoffer21 commented on July 28, 2024

Expanding on this, I also had the same issue. I believe it is related to the .gz compressed xml files in a windows environment. I was eventually able to remedy the issue by moving the archived gameday-data to a backup folder which forced the wrapper to make calls to the server instead of using the archived xml data.

I unfortunately don't have a better work around to offer at this time, other than moving the saved data.

from mlbgame.

panzarino avatar panzarino commented on July 28, 2024

@rhoffer21 I will try to find a better compression format for windows (probably zip). I will also build a delete function into the update module that will allow you to remove all downloaded data.

from mlbgame.

panzarino avatar panzarino commented on July 28, 2024

Released in 2.3.2.

from mlbgame.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.