SyntaxError: Non-UTF-8 code starting with '\xe5' in file ***.py on line 105, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for

用charles抓包时, 对抓到的html,放到pycharm中解析,

结果报错:

SyntaxError: Non-UTF-8 code starting with '\xe5' in file ***.py on line 105, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for

 

我在开头添加了

# -*- encoding:utf-8 -*- 

 之后错误消失, 目前还没搞懂具体原因.

 

posted on 2018-08-07 16:13  shidexiao  阅读(1740)  评论(0编辑  收藏  举报

导航