Closed ediowar closed 4 years ago
Line: 154 try removing .decode('utf-8')
and you might have to remove the bytes
portion as well. This isn't an error of the script, as it is more encoding/decoding issue for the serialization.
You can also look into simplejson if you don't want to deal with encoding/decoding issues.
Other than that, that's my best guess based on your title, and I don't ever use 2.7 unfortunately.
There is no error right now.
line 34 old
if response.status_code == 200:
return response.json()
new
if response.status_code == 200:
if len(response.text) == 0:
print("response is empty")
return {}
return response.json()
OS version: Ubuntu 16.04.6 LTS Python 2.7 requests version: 2.9.1-3ubuntu0.1 lxml version: 3.5.0-1ubuntu0.1 cssselect version: 0.9.1+git90c72b0-1