コード例 #1
0
ファイル: test_crawler.py プロジェクト: celsovlpss/Sabujo
	def test_detectencoding2(self):
		url = 'g1.globo.com'
		response = crawler.download(url)
		data = response.read()
		charset = crawler.detectcharset(response.info(), data)
		self.assertEqual(charset, 'utf-8')
		data.decode(charset)
コード例 #2
0
ファイル: test_crawler.py プロジェクト: celsovlpss/Sabujo
	def test_detectencoding(self):
		response = crawler.download(self.url)
		data = response.read()
		charset = crawler.detectcharset(response.info(), data)
		self.assertEqual(charset, 'iso-8859-1')
		data.decode(charset)