随笔分类 -  python 报错

摘要:在保存网页文字到txt文件下时,出现如下错误 UnicodeEncodeError: 'gbk' codec can't encode character u'\xa9' in position 24051: illegal multibyte sequence 解决方法: with open(“d 阅读全文
posted @ 2017-05-25 14:32 金牛小子 阅读(1164) 评论(0) 推荐(0)
摘要:python错误: EOL while scanning string literal: 这个异常造成的原因是字符串,引号没有成对出现 参考:http://www.jb51.net/article/65067.htm 阅读全文
posted @ 2017-04-13 20:27 金牛小子 阅读(2814) 评论(0) 推荐(0)
摘要:对于刚刚接触python爬虫的人,常常会碰到一个比较烦的问题, 如果网页是GB2312编码格式,我们直接decode(’GB2312‘)一般python都会报错: GB2312不能编码该页面。 这就比较奇怪了 <meta http-equiv="Content-Type" content="text 阅读全文
posted @ 2017-04-11 21:40 金牛小子 阅读(909) 评论(0) 推荐(0)