爬虫学习中遇到的问题

if __name__ == '__main__':

解释:https://zhuanlan.zhihu.com/p/21297237

'gbk' codec can't encode character '\u2b07' in position 17: illegal multibyte sequence

解答:s.decode('gbk', ‘ignore').encode('utf-8′)           http://www.cnblogs.com/baiyuyang/archive/2011/10/29/2228667.html

或者添加   r.endcodding = r.apparent_endconding

posted @ 2018-05-13 20:16  leolaosao  阅读(232)  评论(0编辑  收藏  举报