-
Notifications
You must be signed in to change notification settings - Fork 97
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
Encoding issue when trying to run soccer collect py file #1
Comments
I am sorry about this issue. One quick question: Are you using Python 2.7 or 3.4? I only tested it with 3.4 - since I've always had issues with unicode in Python 2.7 I typically only use Python 3.4 for such things. |
Hi there. Thanks for the swift response. Im using Python 2.7. Its probably the default one installed with this mac. Okay thanks I'll try python 3.4 and let you know. |
You are welcome, and thanks for bringing this up, I will add a note about Python 3 usage to make life easier for other users :). |
Hi there. Thanks for the info. Upgrading to Python 3 did rectify the issue for me. Cheers |
Nice, I am glad to hear! Especially when it comes to text (and "exotic" characters), Python 3 makes life a lot easier ;) |
When i try and run collect_fantasysoccer it threw the following error below
SyntaxError: Non-ASCII character '\xc2' in file collect_fantasysoccer.py on line 415, but no encoding
declared; see http://www.python.org/peps/pep-0263.html for details
I then added the following line to the py file
#coding=UTF-8
Tried to run again, this time it got further but resulted in the following error below
Getting general statistics from https://www.dreamteamfc.com/statistics/players/ALL/ ...
Getting team standings from http://www.espnfc.com/barclays-premier-league/23/table ...
collect_fantasysoccer.py:197: UnicodeWarning: Unicode unequal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
res = [i.text for i in td.next_siblings if isinstance(i, bs4.element.Tag) and i.text!='\xa0']
Traceback (most recent call last):
File "collect_fantasysoccer.py", line 528, in
epl_data.get_all()
File "collect_fantasysoccer.py", line 41, in get_all
self.get_team_standings()
File "collect_fantasysoccer.py", line 199, in get_team_standings
values = [int(i) for i in res[1:]]
ValueError: invalid literal for int() with base 10: ''
Could you advise me as to how to get around this?
Appreciated
The text was updated successfully, but these errors were encountered: