Comments (6)
Everything seems to work when I run the tests on my Windows machine. Could you please post the traceback in here?
from chess.com.
`Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.2.2\plugins\python-ce\helpers\pydev\pydevd.py", line 1448, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.2.2\plugins\python-ce\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/Sabuhi Khalili/PycharmProjects/chesscom/main.py", line 10, in
player = ch.get_player_profile(USERNAME)
File "C:\Users\Sabuhi Khalili.conda\envs\temp\lib\site-packages\chessdotcom\client.py", line 39, in get_player_profile
r = Client.do_get_request(path = f"/player/{username}")
File "C:\Users\Sabuhi Khalili.conda\envs\temp\lib\site-packages\chessdotcom\client.py", line 30, in do_get_request
raise ChessDotComError(status_code=r.status)
chessdotcom.errors.ChessDotComError: [MESSAGE] -- Response not 200.[STATUS CODE] -- 403 [REFERENCE] -- https://www.chess.com/news/view/published-data-api
python-BaseException
Process finished with exit code 1
`
I also send screenshot of response at debugger
I am using Python 3.7
from chess.com.
The server is responding with 403. For some reason you are not allowed to access that resource. Look at this https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403. This might be specific to your IP.
The chessdotcomerror is returned only if the response code is not 200. The code is working as expected.
I do agree that the errors need to be reworked however since the server also returns more useful information on the error. I will roll out an update tonight.
from chess.com.
Thanks. I also think it might be related to ip as I am using some 'public' network, however this problem only emerges on urllib. Using requests or chrome to get response do not return the same error. I will use requests method in my code as a workaround, just wanted to let you know anyway. Good luck with your work
from chess.com.
Yes, I was actually thinking of switching to requests as well. Probably will add that in tonight with proxy support as well.
Thanks for letting me know!
from chess.com.
I updated the package to use requests
package and improved the ChessDotComError
object.
from chess.com.
Related Issues (11)
- Ability to set user-agent contact information? HOT 2
- get_player_games_by_month_pgn top level attribute 'png' HOT 1
- Unable to run demo code HOT 2
- problem with rate limit HOT 2
- response_text is empty HOT 1
- Running with Jupyter notebook causes error
- testendpoint.py HOT 1
- Chess.com requiring changes to 'User-Agent' header HOT 2
- Documentation for Configuring Headers incorrect
- [Error] Could not build wheels for aiohttp HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chess.com.