I have a very basic website-scraper running on my rapsberry pi.
r = get(url)
with open('filename.html', 'w') as f:
f.write(r.text)
Running it in the terminal works as expected. But running it via a cron job gives the following error (found it via mailx)
f.write(r.text)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 67005: ordinal not in range(128)
What causes the script to work when used via the terminal:
>python thescript.py
But it does not work using
30 9 * * * python /home/pi/thescript.py