Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 Error in pfx_parser_csv.py #3

Open
ByronBecker opened this issue Apr 16, 2018 · 3 comments
Open

404 Error in pfx_parser_csv.py #3

ByronBecker opened this issue Apr 16, 2018 · 3 comments

Comments

@ByronBecker
Copy link

I'm currently running your script with a small change (deleting the last "/" from the url in lines 80 & 81, as it has changed), and am getting this error at line 98

Traceback (most recent call last):
  File "pfx_parser_csv.py", line 98, in <module>
    if BeautifulSoup(urlopen(g_url),"lxml").find("a", href="game.xml"):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 532, in open
    response = meth(req, response)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 570, in error
    return self._call_chain(*args)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

Any idea why this might be happening?

@johnchoiniere
Copy link
Owner

Unfortunately, yes -- AFAIK, MLBAM has, as of this year, taken down the old gameday XML, for both new and past games. Don't think this will ever work again, and I'm not currently in a position to try to search out where, if anywhere, the data are now available to update it.

@nleut
Copy link

nleut commented Apr 17, 2018

In addition to removing the last "/" on line 80 and 81, add it back on line 93 by changing the line to g_url = d_url+"/"+g . This has it working for me, at least for 2018

@ByronBecker
Copy link
Author

@nleut tested and works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants