爬虫学习中遇到的问题

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

猜你喜欢

转载自www.cnblogs.com/leolaosao/p/9033167.html
今日推荐