I\'m scraping some webpages using selenium and beautifulsoup. I\'m iterating through a bunch of links, grabbing info, and then dumping it into a JSON:
for e
You might need to set PYTHONIOENCODING before running your python script in the shell. For example, I got the same error while redirecting the python script output into a log file:
$ your_python_script > output.log
'ascii' codec can't encode characters in position xxxxx-xxxxx: ordinal not in range(128)
After changing PYTHONIOENCODING to UTF8 in the shell, script executed with no ASCII codec error:
$ export PYTHONIOENCODING=utf8
$ your_python_script > output.log