摘要: http://hi.baidu.com/ragkk/blog/item/b2f460c2784f0e29e5dd3b8a.htmlhttp://www.pythonclub.org/framework/django/starthttp://www.pythonclub.org/modules/beautifulsoup/encodehttp://doc.scrapy.org/en/latest/intro/tutorial.html#intro-tutorial 阅读全文
posted @ 2012-05-07 15:08 wtx 阅读(148) 评论(0) 推荐(0) 编辑
摘要: BeautifulSoup的编码处理BeautifulSoup内部使用的是Unicode,BeautifulSoup会自动检测输入文件的编码类型将其转换为Unicode。BeautifulSoup编码检测顺序BeautifulSoup按下面的顺序检测编码:创建Soup对象时传递的 fromEncoding 参数;XML/HTML文件自己定义的编码;文件开始几个字节所表示的编码特征,此时能判断的编码只可能是以下编码之一:UTF-*,EBCDIC,和ASCII。如果你安装了chardet,BeautifulSoup会用chardet检测文件编码。UTF-8Windows-1252在Beautifu 阅读全文
posted @ 2012-05-07 11:03 wtx 阅读(3258) 评论(0) 推荐(0) 编辑