コード例 #1
0
ファイル: test_crawler.py プロジェクト: celsovlpss/Sabujo
	def test_readtext(self):
		url = 'http://globoesporte.globo.com/futebol/brasileirao-serie-a/noticia/2012/11/gremio-reage-empata-com-lusa-e-confirma-rebaixamento-do-palmeiras.html'
		soup = crawler.loadbs(url)
		crawler.readtext(soup)
コード例 #2
0
ファイル: test_crawler.py プロジェクト: celsovlpss/Sabujo
	def test_readlinks(self):
		url = 'http://www1.folha.uol.com.br/esporte/1187452-empate-entre-portuguesa-e-gremio-rebaixa-o-palmeiras-a-serie-b.shtml'
		soup = crawler.loadbs(url)
		crawler.readlinks(soup, url)
コード例 #3
0
ファイル: test_crawler.py プロジェクト: celsovlpss/Sabujo
	def test_loadbs2(self):
		urls = ('uol.com.br', 'ig.com.br', 'g1.globo.com', 'apinfo.com')
		for url in urls:
			soup = crawler.loadbs(url)
			self.assertEqual(type(soup), bs4.BeautifulSoup)
コード例 #4
0
ファイル: test_crawler.py プロジェクト: celsovlpss/Sabujo
	def test_readtitle(self):
		url = 'uol.com.br'
		#import pdb; pdb.set_trace()
		soup = crawler.loadbs(url)
		self.assertEqual('UOL - O melhor conteúdo', crawler.readtitle(soup))
コード例 #5
0
ファイル: test_crawler.py プロジェクト: celsovlpss/Sabujo
	def test_loadbs(self):
		soup = crawler.loadbs(self.url)
		self.assertEqual(type(soup), bs4.BeautifulSoup)