Update main.py

Fix error: UnicodeEncodeError: 'ascii' codec can't encode characters in position 38-41: ordinal not in range(128)
This commit is contained in:
Ilyaz 2019-09-21 15:23:14 +04:00 committed by GitHub
parent fe1b049119
commit 8839910e8e
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,7 +79,7 @@ def get_games():
if last_div: if last_div:
game_cost = last_div.getText().replace('(', '').replace(')', '').replace('P', '') game_cost = last_div.getText().replace('(', '').replace(')', '').replace('P', '')
game_name = item.find('a', {'class': 'giveaway__heading__name'}).text game_name = item.find('a', {'class': 'giveaway__heading__name'}).text.encode('utf-8')
if int(points) - int(game_cost) < 0: if int(points) - int(game_cost) < 0:
print('Not enough points to enter: ' + game_name) print('Not enough points to enter: ' + game_name)