|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
Hi,各位
本人好不容易将chardet安装完成了,但是在执行该模块的detect函数时一直在报错。请各位指点一下,非常感谢!!
>>> import urllib.request
>>> response=urllib.request.urlopen('http://fishc.com')
>>> import chardet
>>> chardet.detect(response) #执行就报错
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
chardet.detect(response)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\chardet-3.0.4-py3.6.egg\chardet\__init__.py", line 34, in detect
'{0}'.format(type(byte_str)))
TypeError: Expected object of type bytes or bytearray, got: <class 'http.client.HTTPResponse'>
已经搞了一下午了,新人求助啊~~~~ |
|