lzjun567 / python_scripts

一些python相关的演示代码
Apache License 2.0
716 stars 527 forks source link

一点小错误 #2

Open lupus721 opened 7 years ago

lupus721 commented 7 years ago

在windows10下pip需要安装beautifulsoup4 不加4 默认安装的是3.

在win ubuntu全提示字符错误

windows ERROR:root:瑙f瀽閿欒 Traceback (most recent call last): File "crawler.py", line 56, in parse_url_to_html html = html.encode("utf-8") UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 134: ordinal not in range(128)

ubuntu ERROR:root:解析错误 Traceback (most recent call last): File "crawler.py", line 56, in parse_url_to_html html = html.encode("utf-8") UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 134: ordinal not in range(128) ERROR:root:解析错误 Traceback (most recent call last): File "crawler.py", line 56, in parse_url_to_html html = html.encode("utf-8")

lupus721 commented 7 years ago

简单粗暴的解决方法是encode都注释掉,能跑