UnicodeDecodeError: ‘XXX' codec can't decode bytes in position 2-5: illegal multibyte sequence
这个是编码格式错误 多试几个格式
#!/usr/bin/env python
#-*- coding: gb18030 -*-
from urllib2 import urlopen
import re
#网易公开课 下载地址抓取
url='http://v.163.com/special/Khan/arithmetic.html'
web=urlopen(url)
read_web=web.read().decode("gb18030") # utf-8 gbk gb2312
web.close()
浙公网安备 33010602011771号