reyinever

chardet不是python自带的包需要手动安装

chardet安装命令(dos下):

         pip install chardet  

或: pip.exe install chardet  

案例:

>>> import chardet
>>> import urllib
>>> TestData=urllib.urlopen("http://www.baidu.com/").read()
>>> print chardet.detect(TestData)
{\'confidence\': 0.99, \'language\': \'\', \'encoding\': \'utf-8\'}
>>>

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2022-02-09
  • 2021-09-19
  • 2021-11-28
  • 2022-03-01
  • 2022-12-23
猜你喜欢
  • 2022-02-09
  • 2021-10-14
  • 2021-07-10
  • 2022-02-09
  • 2022-02-09
  • 2022-12-23
  • 2021-10-18
相关资源
相似解决方案