fundamentus_data 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/Gemfile +3 -0
- data/README.md +61 -0
- data/Rakefile +7 -0
- data/fundamentus_data.gemspec +15 -0
- data/lib/fundamentus_data.rb +1 -0
- data/lib/fundamentus_data/fundamentus_data.rb +19 -0
- data/lib/fundamentus_data/fundamentus_fetcher.rb +25 -0
- data/lib/fundamentus_data/fundamentus_parser.rb +64 -0
- data/lib/fundamentus_data/util/file_manager.rb +21 -0
- data/lib/fundamentus_data/util/url_fetcher.rb +29 -0
- data/test/config.rb +5 -0
- data/test/data/petr4.html +345 -0
- data/test/data/vale5.html +345 -0
- data/test/fundamentus_acceptance_test.rb +42 -0
- data/test/fundamentus_fetcher_test.rb +27 -0
- data/test/fundamentus_parser_test.rb +57 -0
- data/test/lib/local_file_fetcher.rb +17 -0
- data/test/output/.keep +0 -0
- metadata +100 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 092ab11b3f4033886da92443708d67f96728c4ef
|
4
|
+
data.tar.gz: bbecfc85d129476fddebd24c9601a498975e9e97
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 072ff24f077a5e77a2e42eeb5c3be80a19fd2dcdfe2ecdbc573e14fd1ad7840be8a1b51465cd7f40843a6f4ce2544ed9d3b41f923496dbe445e7516254d8c5b7
|
7
|
+
data.tar.gz: fe23d5336957c2ff16cbf8f800e52907f0295a328ab5b6ec84cd987b2d2dc6b5df3a68a550e83ce6652fa3592a6f446903ce28e54768fa25fecaa2f1a717dcb3
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
# What is this?
|
2
|
+
|
3
|
+
Save stocks financial information from [fundamentus.com.br](http://www.fundamentus.com.br) in JSON format.
|
4
|
+
|
5
|
+
Tags: bovespa, stock market, bolsa de valores, brasil, brazilian, ações
|
6
|
+
|
7
|
+
# Status
|
8
|
+
|
9
|
+
Currently only the fields specified in the following hash are being retrieved:
|
10
|
+
|
11
|
+
LABEL_MAP = {
|
12
|
+
:share_count => 'Nro. Ações',
|
13
|
+
:market_cap => 'Valor de mercado',
|
14
|
+
:last_processed => 'Últ balanço processado',
|
15
|
+
:pl => 'P/L',
|
16
|
+
:pvp => 'P/VP',
|
17
|
+
:pebit => 'P/EBIT',
|
18
|
+
:lpa => 'LPA',
|
19
|
+
:vpa => 'VPA',
|
20
|
+
:net_margin => 'Marg. Líquida',
|
21
|
+
:net_debt => 'Dív. Líquida',
|
22
|
+
:net_assets => 'Patrim. Líq',
|
23
|
+
:yearly_net_income => 'Receita Líquida',
|
24
|
+
:yearly_net_profit => 'Lucro Líquido',
|
25
|
+
:quarterly_net_income => ['Receita Líquida', 2],
|
26
|
+
:quarterly_net_profit => ['Lucro Líquido', 2]
|
27
|
+
}
|
28
|
+
|
29
|
+
# Installation
|
30
|
+
|
31
|
+
gem install fundamentus_data
|
32
|
+
|
33
|
+
# Usage
|
34
|
+
|
35
|
+
require 'fundamentus_data'
|
36
|
+
|
37
|
+
FundamentusData.save ['PETR4', 'BBDC4', 'PSSA3'], './data', :verbose => true
|
38
|
+
|
39
|
+
# License
|
40
|
+
|
41
|
+
The MIT License (MIT)
|
42
|
+
|
43
|
+
Copyright (c) 2014 Vinicius Pinto
|
44
|
+
|
45
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
46
|
+
of this software and associated documentation files (the "Software"), to deal
|
47
|
+
in the Software without restriction, including without limitation the rights
|
48
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
49
|
+
copies of the Software, and to permit persons to whom the Software is
|
50
|
+
furnished to do so, subject to the following conditions:
|
51
|
+
|
52
|
+
The above copyright notice and this permission notice shall be included in all
|
53
|
+
copies or substantial portions of the Software.
|
54
|
+
|
55
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
56
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
57
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
58
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
59
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
60
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
61
|
+
SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'fundamentus_data'
|
3
|
+
s.version = '0.1.0'
|
4
|
+
s.license = 'MIT'
|
5
|
+
s.summary = 'Save brazilian stock data from the Fundamentus site in JSON format'
|
6
|
+
s.description = 'Fundamentus.com.br is a brazilian site that provides financial information about companies listed in Bovespa (the brazilian stock market). This gem can be used to save data from specified stocks in JSON format for later processing.'
|
7
|
+
s.author = 'Vinicius Pinto'
|
8
|
+
s.email = 'contact@codense.com'
|
9
|
+
s.homepage = 'http://github.com/viniciuspinto/fundamentus'
|
10
|
+
s.files = `git ls-files`.split("\n") | Dir.glob('fundamentus_data/**/*')
|
11
|
+
s.test_files = `git ls-files -- test/*`.split("\n")
|
12
|
+
|
13
|
+
s.add_dependency 'nokogiri', '~> 1.6'
|
14
|
+
s.add_development_dependency 'minitest', '~> 5.5'
|
15
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require_relative './fundamentus_data/fundamentus_data.rb'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require_relative './fundamentus_fetcher'
|
2
|
+
require_relative './fundamentus_parser'
|
3
|
+
require_relative './util/url_fetcher'
|
4
|
+
require_relative './util/file_manager'
|
5
|
+
|
6
|
+
class FundamentusData
|
7
|
+
def self.save(stock_codes, destination_path, options = {})
|
8
|
+
destination_path = File.expand_path(destination_path, Dir.pwd) + '/'
|
9
|
+
|
10
|
+
html_fetcher = UrlFetcher.new(options)
|
11
|
+
pages = FundamentusFetcher.new(html_fetcher, options).fetch(stock_codes)
|
12
|
+
file_manager = FileManager.new(destination_path, options)
|
13
|
+
parser = FundamentusParser.new(options)
|
14
|
+
|
15
|
+
pages.each do |key, content|
|
16
|
+
file_manager.save(key + '.json', parser.parse(content).to_json)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class FundamentusFetcher
|
2
|
+
|
3
|
+
def initialize(fetcher, options = {})
|
4
|
+
@fetcher = fetcher
|
5
|
+
if options.has_key?(:verbose)
|
6
|
+
@verbose = options[:verbose]
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def fetch(stock_codes)
|
11
|
+
if not stock_codes.is_a?(Array)
|
12
|
+
stock_codes = [stock_codes]
|
13
|
+
end
|
14
|
+
urls = {}
|
15
|
+
stock_codes.each do |code|
|
16
|
+
urls[code] = url_for code
|
17
|
+
end
|
18
|
+
return @fetcher.fetch(urls)
|
19
|
+
end
|
20
|
+
|
21
|
+
def url_for(code)
|
22
|
+
'http://www.fundamentus.com.br/detalhes.php?papel=' + code
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
|
3
|
+
class FundamentusParser
|
4
|
+
|
5
|
+
LABEL_MAP = {
|
6
|
+
:share_count => 'Nro. Ações',
|
7
|
+
:market_cap => 'Valor de mercado',
|
8
|
+
:last_processed => 'Últ balanço processado',
|
9
|
+
:pl => 'P/L',
|
10
|
+
:pvp => 'P/VP',
|
11
|
+
:pebit => 'P/EBIT',
|
12
|
+
:lpa => 'LPA',
|
13
|
+
:vpa => 'VPA',
|
14
|
+
:net_margin => 'Marg. Líquida',
|
15
|
+
:net_debt => 'Dív. Líquida',
|
16
|
+
:net_assets => 'Patrim. Líq',
|
17
|
+
:yearly_net_income => 'Receita Líquida',
|
18
|
+
:yearly_net_profit => 'Lucro Líquido',
|
19
|
+
:quarterly_net_income => ['Receita Líquida', 2],
|
20
|
+
:quarterly_net_profit => ['Lucro Líquido', 2]
|
21
|
+
}
|
22
|
+
|
23
|
+
def initialize(options = {})
|
24
|
+
if options.has_key?(:verbose)
|
25
|
+
@verbose = options[:verbose]
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def parse(content)
|
30
|
+
@doc = Nokogiri::HTML.parse(content)
|
31
|
+
parsed = {}
|
32
|
+
LABEL_MAP.each do |key, label|
|
33
|
+
if label.is_a?(Array)
|
34
|
+
parsed[key] = read_value_with_label(label[0], label[1])
|
35
|
+
else
|
36
|
+
parsed[key] = read_value_with_label(label)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
parsed
|
40
|
+
end
|
41
|
+
|
42
|
+
private
|
43
|
+
|
44
|
+
def read_value_with_label(label, index = 1)
|
45
|
+
label_td = find_td_with_label(label, index)
|
46
|
+
if label_td
|
47
|
+
data = label_td.next_element().css('span.txt').first.text.strip
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def find_td_with_label(label, index = 1)
|
52
|
+
count = 0
|
53
|
+
@doc.css('body.detalhes div.conteudo td span.txt').each do |item|
|
54
|
+
if item.content.strip == label
|
55
|
+
count += 1
|
56
|
+
if count == index
|
57
|
+
return item.parent()
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
nil
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
class FileManager
|
4
|
+
|
5
|
+
def initialize(dir_path, options = {})
|
6
|
+
@dir_path = dir_path
|
7
|
+
if options.has_key?(:verbose)
|
8
|
+
@verbose = options[:verbose]
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def save(file_name, content)
|
13
|
+
if @verbose
|
14
|
+
puts "Saving content of length #{content.size} to #{@dir_path + file_name}"
|
15
|
+
end
|
16
|
+
File.open(@dir_path + file_name, 'w') do |f|
|
17
|
+
f.write(content)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'open-uri'
|
2
|
+
|
3
|
+
class UrlFetcher
|
4
|
+
|
5
|
+
def initialize(options = {})
|
6
|
+
if options.has_key?(:verbose)
|
7
|
+
@verbose = options[:verbose]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def fetch(urls)
|
12
|
+
responses = {}
|
13
|
+
urls.each do |key, url|
|
14
|
+
if @verbose
|
15
|
+
puts "Downloading #{key} from #{url}"
|
16
|
+
end
|
17
|
+
responses[key] = download(url)
|
18
|
+
sleep(0.5)
|
19
|
+
end
|
20
|
+
responses
|
21
|
+
end
|
22
|
+
|
23
|
+
def download(url)
|
24
|
+
open(url) do |f|
|
25
|
+
f.read
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
data/test/config.rb
ADDED
@@ -0,0 +1,345 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2
|
+
<html lang="pt-br">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
5
|
+
<title>FUNDAMENTUS - PETR4 - Invista consciente - Indicadores Fundamentalistas</title>
|
6
|
+
|
7
|
+
<link rel="stylesheet" href="css/estilo.css" type="text/css" media="screen, projection">
|
8
|
+
<link rel="stylesheet" href="css/print.css" type="text/css" media="print">
|
9
|
+
<link rel="shortcut icon" href="img/fundamentus.ico" type="image/x-icon">
|
10
|
+
<!--[if lte IE 6]>
|
11
|
+
<link rel="stylesheet" type="text/css" href="css/menu_ie6.css">
|
12
|
+
<script type="text/javascript" src="script/ADxMenu.js"></script>
|
13
|
+
<![endif]-->
|
14
|
+
<script src="script/mootools.svn.js" type="text/javascript"></script>
|
15
|
+
<script type="text/javascript" src="script/Observer.js"></script>
|
16
|
+
<script type="text/javascript" src="script/Autocompleter.js"></script>
|
17
|
+
<script src="script/cmplte.php" type="text/javascript" language="JavaScript"></script>
|
18
|
+
|
19
|
+
<script src="script/tip.js" type="text/javascript" language="JavaScript"></script>
|
20
|
+
<script type="text/javascript">
|
21
|
+
function poApple() { }
|
22
|
+
</script>
|
23
|
+
|
24
|
+
</head>
|
25
|
+
<body class="detalhes">
|
26
|
+
<!-- ClickTale Top part -->
|
27
|
+
<script type="text/javascript">
|
28
|
+
var WRInitTime=(new Date()).getTime();
|
29
|
+
</script>
|
30
|
+
<!-- ClickTale end of Top part -->
|
31
|
+
|
32
|
+
<div class="center">
|
33
|
+
<div class="topo">
|
34
|
+
<a href="index.php"><img class="logo" src="img/logo.gif" alt="FUNDAMENTUS - Invista consciente"></a>
|
35
|
+
<div class="avancada"><a href="buscaavancada.php">Busca avançada por empresa</a></div>
|
36
|
+
<form class="busca" method="get" action="detalhes.php">
|
37
|
+
<fieldset>
|
38
|
+
<legend>Procurar por ação/empresa</legend>
|
39
|
+
<input class="texto" autocomplete="off" id="completar" name="papel" type="text"><input type="image" src="img/bt_exibir.jpg" class="botao" value="Exibir"><br>
|
40
|
+
</fieldset>
|
41
|
+
</form>
|
42
|
+
<div class="atual"><p>Você está vendo<strong>PETR4</strong></p></div> <div id="containerMenu">
|
43
|
+
<ul id="menu" class="institucional adxm menu">
|
44
|
+
<li><a class="home" href="index.php">Página inicial</a></li>
|
45
|
+
<!--- <li><a class="conheca" href="conheca.php">Conheça o sistema</a></li> --->
|
46
|
+
<li><a class="consciente" href="consciente.php">Investimento consciente</a></li>
|
47
|
+
<li><a class="contato" href="contato.php">Entre em contato</a></li>
|
48
|
+
</ul>
|
49
|
+
<ul id="menu" class="software adxm menu">
|
50
|
+
<li><a class="detalhes" href="detalhes.php">Detalhes</a></li>
|
51
|
+
<li><a class="graficos" onClick="poApple()" >Gráficos</a>
|
52
|
+
<ul>
|
53
|
+
<li><a href="graficos.php?papel=PETR4&tipo=1">Balanço patrimonial</a></li>
|
54
|
+
<li><a href="graficos.php?papel=PETR4&tipo=2">Demonstrativos de resultados</a></li>
|
55
|
+
<li><a href="graficos.php?papel=PETR4&tipo=3">Indicadores fundamentalistas</a></li>
|
56
|
+
</ul>
|
57
|
+
</li>
|
58
|
+
<li><a class="historicos" onClick="poApple()">Dados Históricos</a>
|
59
|
+
<ul class="provetos">
|
60
|
+
<li><a class="dh" href="balancos.php?papel=PETR4&tipo=1">Balanços em Excel</a></li>
|
61
|
+
<li><a class="dh" href="proventos.php?papel=PETR4&tipo=2">Proventos</a></li>
|
62
|
+
</ul>
|
63
|
+
</li>
|
64
|
+
<li><a class="cotacoes" href="cotacoes.php?papel=PETR4">Histórico de cotações</a></li>
|
65
|
+
</li>
|
66
|
+
</ul>
|
67
|
+
</div>
|
68
|
+
</div>
|
69
|
+
<div class="conteudo clearfix">
|
70
|
+
|
71
|
+
<div style="float: right; width: 180px;">
|
72
|
+
<script type="text/javascript"><!--
|
73
|
+
google_ad_client = "ca-pub-3119085269630402";
|
74
|
+
/* anuncioVerticalDireita */
|
75
|
+
google_ad_slot = "8411733769";
|
76
|
+
google_ad_width = 160;
|
77
|
+
google_ad_height = 600;
|
78
|
+
//-->
|
79
|
+
</script>
|
80
|
+
<script type="text/javascript"
|
81
|
+
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
82
|
+
</script>
|
83
|
+
</div>
|
84
|
+
<table class="w728">
|
85
|
+
<tr>
|
86
|
+
<td class="label w15"><span class="help tips" title="Código da ação">?</span><span class="txt">Papel</span></td>
|
87
|
+
<td class="data w35"><span class="txt">PETR4</span></td>
|
88
|
+
<td class="label destaque w2"><span class="help tips" title="Cotação de fechamento da ação no último pregão">?</span><span class="txt">Cotação</span></td>
|
89
|
+
<td class="data destaque w3"><span class="txt">15,44</span></td>
|
90
|
+
</tr>
|
91
|
+
<tr>
|
92
|
+
<td class="label"><span class="help tips" title="ON = Ordinária, PN = Preferencial, PNA = Pref. tipo A, etc">?</span><span class="txt">Tipo</span></td>
|
93
|
+
<td class="data"><span class="txt">PN</span></td>
|
94
|
+
<td class="label"><span class="help tips" title="Data do último pregão em que o ativo foi negociado">?</span><span class="txt">Data últ cot</span></td>
|
95
|
+
<td class="data"><span class="txt">04/04/2014</span></td>
|
96
|
+
</tr>
|
97
|
+
<tr>
|
98
|
+
<td class="label"><span class="help tips" title="Nome comercial da empresa.">?</span><span class="txt">Empresa</span></td>
|
99
|
+
<td class="data"><span class="txt">PETROBRAS PN</span></td>
|
100
|
+
<td class="label"><span class="help tips" title="Menor cotação da ação nos últimos 12 meses.">?</span><span class="txt">Min 52 sem</span></td>
|
101
|
+
<td class="data"><span class="txt">11,81</span></td>
|
102
|
+
</tr>
|
103
|
+
<tr>
|
104
|
+
<td class="label"><span class="help tips" title="Classificação setorial">?</span><span class="txt">Setor</span></td>
|
105
|
+
<td class="data"><span class="txt"><a href="resultado.php?setor=1">Petróleo, Gás e Biocombustíveis</a></span></td>
|
106
|
+
<td class="label"><span class="help tips" title="Maior cotação da ação nos últimos 12 meses">?</span><span class="txt">Max 52 sem</span></td>
|
107
|
+
<td class="data"><span class="txt">20,14</span></td>
|
108
|
+
</tr>
|
109
|
+
<tr>
|
110
|
+
<td class="label"><span class="help tips" title="Classificação por segmento de atuação.">?</span><span class="txt">Subsetor</span></td>
|
111
|
+
<td class="data"><span class="txt"><a href="resultado.php?segmento=1">Exploração e/ou Refino</a></span></td>
|
112
|
+
<td class="label"><span class="help tips" title="Volume médio de negociação da ação nos últimos 2 meses (R$)">?</span><span class="txt">Vol $ méd (2m)</span></td>
|
113
|
+
<td class="data"><span class="txt">500.986.000</span></td>
|
114
|
+
</tr>
|
115
|
+
</table>
|
116
|
+
<table class="w728">
|
117
|
+
<tr>
|
118
|
+
<td class="label w2"><span class="help tips" title="Valor de mercado da empresa, calculado multiplicando o preço da ação pelo número total de ações.">?</span><span class="txt">Valor de mercado</span></td>
|
119
|
+
<td class="data w3"><span class="txt">201.407.000.000</span></td>
|
120
|
+
<td class="label w3"><span class="help tips" title="Data do último balanço divulgado pela empresa que consta no nosso banco de dados. Todos os indicadores são calculados considerando os últimos 12 meses finalizados na data deste balanço.">?</span><span class="txt">Últ balanço processado</span></td>
|
121
|
+
<td class="data w2"><span class="txt">31/12/2013</span></td>
|
122
|
+
</tr>
|
123
|
+
<tr>
|
124
|
+
<td class="label w2"><span class="help tips" title="Valor da firma (Enterprise Value) é calculado somando o valor de mercado da empresa a sua dívida líquida.">?</span><span class="txt">Valor da firma</span></td>
|
125
|
+
<td class="data w3"><span class="txt">422.956.000.000</span></td>
|
126
|
+
<td class="label"><span class="help tips" title="Número total de ações, somadas todas as espécies: ON, PN, etc">?</span><span class="txt">Nro. Ações</span></td>
|
127
|
+
<td class="data"><span class="txt">13.044.500.000</span></td>
|
128
|
+
</tr>
|
129
|
+
</table>
|
130
|
+
<table class="w728">
|
131
|
+
<tr>
|
132
|
+
<td class="nivel1" colspan="2"><span class="txt">Oscilações</span></td>
|
133
|
+
<td class="nivel1" colspan="4"><span class="txt">Indicadores fundamentalistas</span></td>
|
134
|
+
</tr>
|
135
|
+
<tr>
|
136
|
+
<td class="label w1"><span class="txt">Dia</span></td>
|
137
|
+
<td class="data w1"><span class="oscil"><font color="#306EFF">0,26%</font></span></td>
|
138
|
+
<td class="label w2"><span class="help tips" title="Preço da ação dividido pelo lucro por ação. O P/L é o número de anos que se levaria para reaver o capital aplicado na compra de uma ação, através do recebimento do lucro gerado pela empresa, considerando que esses lucros permaneçam constantes.">?</span><span class="txt">P/L</span></td>
|
139
|
+
<td class="data w2"><span class="txt">8,54</span></td>
|
140
|
+
<td class="label w2"><span class="help tips" title="Lucro por Ação">?</span><span class="txt">LPA</span></td>
|
141
|
+
<td class="data w2"><span class="txt">1,81</span></td>
|
142
|
+
</tr>
|
143
|
+
<tr>
|
144
|
+
<td class="label w1"><span class="txt">Mês</span></td>
|
145
|
+
<td class="data w1"><span class="oscil"><font color="#306EFF">4,96%</font></span></td>
|
146
|
+
<td class="label w2"><span class="help tips" title="Preço da ação dividido pelo Valor Patrimonial por ação. Informa quanto o mercado está disposto a pagar sobre o Patrimônio Líquido da empresa">?</span><span class="txt">P/VP</span></td>
|
147
|
+
<td class="data w2"><span class="txt">0,58</span></td>
|
148
|
+
<td class="label w2"><span class="help tips" title="Valor Patrimonial por Ação: Valor do Patrimônio Líquido dividido pelo número total de ações.">?</span><span class="txt">VPA</span></td>
|
149
|
+
<td class="data w2"><span class="txt">26,67</span></td>
|
150
|
+
</tr>
|
151
|
+
<tr>
|
152
|
+
<td class="label w1"><span class="txt">30 dias</span></td>
|
153
|
+
<td class="data w1"><span class="oscil"><font color="#306EFF">20,91%</font></span></td>
|
154
|
+
<td class="label w2"><span class="help tips" title="Preço da ação dividido pelo EBIT por ação. EBIT é o Lucro antes dos Impostos e Despesas Financeiras. É uma boa aproximação do lucro operacional da empresa.">?</span><span class="txt">P/EBIT</span></td>
|
155
|
+
<td class="data w2"><span class="txt">
|
156
|
+
4,04</span></td>
|
157
|
+
<td class="label"><span class="help tips" title="Lucro Bruto dividido pela Receita Líquida: Indica a porcentagem de cada R$1 de venda que sobrou após o custo dos produtos/serviços vendidos">?</span><span class="txt">Marg. Bruta</span></td>
|
158
|
+
<td class="data"><span class="txt">
|
159
|
+
23,3%</span></td>
|
160
|
+
</tr>
|
161
|
+
<tr>
|
162
|
+
<td class="label w1"><span class="txt">12 meses</span></td>
|
163
|
+
<td class="data w1"><span class="oscil"><font color="#F75D59">-5,04%</font></span></td>
|
164
|
+
<td class="label"><span class="help tips" title="Price Sales Ratio: Preço da ação dividido pela Receita Líquida por ação">?</span><span class="txt">PSR</span></td>
|
165
|
+
<td class="data"><span class="txt">
|
166
|
+
0,66</span></td>
|
167
|
+
<td class="label"><span class="help tips" title="EBIT dividido pela Receita Líquida: Indica a porcentagem de cada R$1 de venda que sobrou após o pagamento dos custos dos produtos/serviços vendidos, das despesas com vendas, gerais e administrativas">?</span><span class="txt">Marg. EBIT</span></td>
|
168
|
+
<td class="data"><span class="txt">
|
169
|
+
16,3%</span></td>
|
170
|
+
</tr>
|
171
|
+
<tr>
|
172
|
+
<td class="label w1"><span class="txt">2014</span></td>
|
173
|
+
<td class="data w1"><span class="oscil"><font color="#F75D59">-3,80%</font></span></td>
|
174
|
+
<td class="label w2"><span class="help tips" title="Preço da ação dividido pelos Ativos totais por ação.">?</span><span class="txt">P/Ativos</span></td>
|
175
|
+
<td class="data w2"><span class="txt">
|
176
|
+
0,27</span></td>
|
177
|
+
<td class="label"><span class="help tips" title="Lucro Líquido dividido pela Receita Líquida">?</span><span class="txt">Marg. Líquida</span></td>
|
178
|
+
<td class="data"><span class="txt">
|
179
|
+
7,5%</span></td>
|
180
|
+
</tr>
|
181
|
+
<tr>
|
182
|
+
<td class="label w1"><span class="txt">2013</span></td>
|
183
|
+
<td class="data w1"><span class="oscil"><font color="#F75D59">-9,01%</font></span></td>
|
184
|
+
<td class="label w2"><span class="help tips" title="Preço da ação dividido pelo capital de giro por ação. Capital de giro é o Ativo Circulante menos Passivo Circulante">?</span><span class="txt">P/Cap. Giro</span></td>
|
185
|
+
<td class="data w2"><span class="txt">
|
186
|
+
4,93</span></td>
|
187
|
+
<td class="label"><span class="help tips" title="EBIT dividido por Ativos totais">?</span><span class="txt">EBIT / Ativo</span></td>
|
188
|
+
<td class="data"><span class="txt">6,6%</span></td>
|
189
|
+
</tr>
|
190
|
+
<tr>
|
191
|
+
<td class="label w1"><span class="txt">2012</span></td>
|
192
|
+
<td class="data w1"><span class="oscil"><font color="#F75D59">-6,86%</font></span></td>
|
193
|
+
<td class="label w2"><span class="help tips" title="Preço da ação dividido pelos Ativos Circulantes Líquidos por ação. Ativo Circ. Líq. é obtido subtraindo os ativos circulantes pelas dívidas de curto e longo prazo, ou seja, após o pagamento de todas as dívidas, quanto sobraria dos ativos mais líquidos da empresa (caixa, estoque, etc)">?</span><span class="txt">P/Ativ Circ Liq</span></td>
|
194
|
+
<td class="data w2"><span class="txt">
|
195
|
+
-0,72</span></td>
|
196
|
+
<td class="label"><span class="help tips" title="Retorno sobre o Capital Investido: Calculado dividindo-se o EBIT por (Ativos - Fornecedores - Caixa). Informa o retorno que a empresa consegue sobre o capital total aplicado.">?</span><span class="txt">ROIC</span></td>
|
197
|
+
<td class="data"><span class="txt">
|
198
|
+
7,3%</span></td>
|
199
|
+
</tr>
|
200
|
+
<tr>
|
201
|
+
<td class="label w1"><span class="txt">2011</span></td>
|
202
|
+
<td class="data w1"><span class="oscil"><font color="#F75D59">-18,29%</font></span></td>
|
203
|
+
<td class="label"><span class="help tips" title="Dividend Yield: Dividendo pago por ação dividido pelo preço da ação. É o rendimento gerado para o dono da ação pelo pagamento de dividendos.">?</span><span class="txt">Div. Yield</span></td>
|
204
|
+
<td class="data"><span class="txt">5,0%</span></td>
|
205
|
+
<td class="label"><span class="help tips" title="Retorno sobre o Patrimônio Líquido: Lucro líquido dividido pelo Patrimônio Líquido">?</span><span class="txt">ROE</span></td>
|
206
|
+
<td class="data"><span class="txt">
|
207
|
+
6,8%</span></td>
|
208
|
+
</tr>
|
209
|
+
<tr>
|
210
|
+
<td class="label w1"><span class="txt">2010</span></td>
|
211
|
+
<td class="data w1"><span class="oscil"><font color="#F75D59">-22,99%</font></span></td>
|
212
|
+
<td class="label"><span class="help tips" title="Valor da Firma (Enterprise Value dividido pelo EBIT.">?</span><span class="txt">EV / EBIT</span></td>
|
213
|
+
<td class="data"><span class="txt">
|
214
|
+
8,49</span></td>
|
215
|
+
<td class="label"><span class="help tips" title="Ativo Circulante dividido pelo Passivo Circulante: Reflete a capacidade de pagamento da empresa no curto prazo.">?</span><span class="txt">Liquidez Corr</span></td>
|
216
|
+
<td class="data"><span class="txt">
|
217
|
+
1,49</span></td>
|
218
|
+
</tr>
|
219
|
+
<tr>
|
220
|
+
<td class="label w1"><span class="txt">2009</span></td>
|
221
|
+
<td class="data w1"><span class="oscil"><font color="#306EFF">52,17%</font></span></td>
|
222
|
+
<td class="label"><span class="help tips" title="Receita Líquida dividido por Ativos Totais. Indica a eficiência com a qual a empresa usa seus ativos para gerar vendas">?</span><span class="txt">Giro Ativos</span></td>
|
223
|
+
<td class="data"><span class="txt">
|
224
|
+
0,40</span></td>
|
225
|
+
<td class="label"><span class="help tips" title="Dívida Bruta total (Dívida+Debêntures) dividido pelo Patrimônio Líquido">?</span><span class="txt">Div Br/ Patrim</span></td>
|
226
|
+
<td class="data"><span class="txt">
|
227
|
+
0,77</span></td>
|
228
|
+
</tr>
|
229
|
+
<tr>
|
230
|
+
<td class="label w1"><span class="txt"></span></td>
|
231
|
+
<td class="data w1"><span class="oscil"></span></td>
|
232
|
+
<td class="label"><span class="help tips" title="Crescimento da Receita Líquida nos últimos 5 anos">?</span><span class="txt">Cres. Rec (5a)</span></td>
|
233
|
+
<td class="data"><span class="txt">
|
234
|
+
13,9%</span></td>
|
235
|
+
<td class="label"><span class="txt"></span></td>
|
236
|
+
<td class="data"><span class="txt"></span></td>
|
237
|
+
</tr>
|
238
|
+
</table>
|
239
|
+
|
240
|
+
<table class="w728">
|
241
|
+
<tr>
|
242
|
+
<td class="nivel1" colspan="4"><span class="txt">Dados Balanço Patrimonial</span></td>
|
243
|
+
</tr>
|
244
|
+
<tr>
|
245
|
+
<td class="label w2"><span class="help tips" title="Todos os bens, direitos e valores a receber de uma entidade">?</span><span class="txt">Ativo</span></td>
|
246
|
+
<td class="data w3"><span class="txt">752.967.000.000</span></td>
|
247
|
+
<td class="label w2"><span class="help tips" title="Dívida Bruta é obtida somando-se as dívidas de curto e longo prazo mais as debêntures de curto e longo prazo.">?</span><span class="txt">Dív. Bruta</span></td>
|
248
|
+
<td class="data w3"><span class="txt">267.821.000.000</span></td>
|
249
|
+
</tr>
|
250
|
+
<tr>
|
251
|
+
<td class="label"><span class="help tips" title="Contas que representam bens numerários (Dinheiro)">?</span><span class="txt">Disponibilidades</span></td>
|
252
|
+
<td class="data"><span class="txt">46.272.400.000</span></td>
|
253
|
+
<td class="label"><span class="help tips" title="Dívida Bruta menos Disponibilidades. Se este valor é negativo, significa que a empresa possui caixa líquido positivo.">?</span><span class="txt">Dív. Líquida</span></td>
|
254
|
+
<td class="data"><span class="txt">221.549.000.000</span></td>
|
255
|
+
</tr>
|
256
|
+
<tr>
|
257
|
+
<td class="label"><span class="help tips" title="Bens ou direitos que podem ser convertido em dinheiro em curto prazo">?</span><span class="txt">Ativo Circulante</span></td>
|
258
|
+
<td class="data"><span class="txt">123.350.000.000</span></td>
|
259
|
+
<td class="label"><span class="help tips" title="O patrimônio líquido representa os valores que os sócios ou acionistas têm na empresa em um determinado momento. No balanço patrimonial, a diferença entre o valor dos ativos e dos passivos e resultado de exercícios futuros representa o PL (Patrimônio Líquido), que é o valor contábil devido pela pessoa jurídica aos sócios ou acionistas.">?</span><span class="txt">Patrim. Líq</span></td>
|
260
|
+
<td class="data"><span class="txt">347.940.000.000</span></td>
|
261
|
+
</tr>
|
262
|
+
</table>
|
263
|
+
|
264
|
+
<table class="w728">
|
265
|
+
<tr>
|
266
|
+
<td class="nivel1" colspan="4"><span class="txt">Dados demonstrativos de resultados</span></td>
|
267
|
+
</tr>
|
268
|
+
<tr>
|
269
|
+
<td class="nivel2 w5" colspan="2"><span class="txt">Últimos 12 meses</span></td>
|
270
|
+
<td class="nivel2 w5" colspan="2"><span class="txt">Últimos 3 meses</span></td>
|
271
|
+
</tr>
|
272
|
+
<tr>
|
273
|
+
<td class="label w2" ><span class="help tips" title="Receita Líquida é a soma de todas as vendas da empresa em determinado período deduzido de devoluções, descontos e alguns impostos.">?</span><span class="txt">Receita Líquida</span></td>
|
274
|
+
<td class="data w3"><span class="txt">304.890.000.000</span></td>
|
275
|
+
<td class="label w2"><span class="help tips" title="Receita Líquida é a soma de todas as vendas da empresa em determinado período deduzido de devoluções, descontos e alguns impostos.">?</span><span class="txt">Receita Líquida</span></td>
|
276
|
+
<td class="data w3"><span class="txt">81.028.000.000</span></td>
|
277
|
+
</tr>
|
278
|
+
<tr>
|
279
|
+
<td class="label"><span class="help tips" title="Earnings Before Interest and Taxes - Lucro antes dos impostos e juros: Uma aproximação do lucro operacional da empresa.">?</span><span class="txt">EBIT</span></td>
|
280
|
+
<td class="data"><span class="txt">49.811.800.000</span></td>
|
281
|
+
<td class="label"><span class="help tips" title="Earnings Before Interest and Taxes - Lucro antes dos impostos e juros: Uma aproximação do lucro operacional da empresa.">?</span><span class="txt">EBIT</span></td>
|
282
|
+
<td class="data"><span class="txt">11.234.800.000</span></td>
|
283
|
+
</tr>
|
284
|
+
<tr>
|
285
|
+
<td class="label"><span class="help tips" title="O que sobra das vendas após o todas as despesas.">?</span><span class="txt">Lucro Líquido</span></td>
|
286
|
+
<td class="data"><span class="txt">23.570.400.000</span></td>
|
287
|
+
<td class="label"><span class="help tips" title="O que sobra das vendas após o todas as despesas.">?</span><span class="txt">Lucro Líquido</span></td>
|
288
|
+
<td class="data"><span class="txt">6.281.530.000</span></td>
|
289
|
+
</tr>
|
290
|
+
</table>
|
291
|
+
<BR>
|
292
|
+
<script type="text/javascript"><!--
|
293
|
+
google_ad_client = "ca-pub-3119085269630402";
|
294
|
+
/* anuncioRodape */
|
295
|
+
google_ad_slot = "1513786315";
|
296
|
+
google_ad_width = 728;
|
297
|
+
google_ad_height = 90;
|
298
|
+
//-->
|
299
|
+
</script>
|
300
|
+
<script type="text/javascript"
|
301
|
+
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
302
|
+
</script>
|
303
|
+
|
304
|
+
|
305
|
+
</div>
|
306
|
+
</div>
|
307
|
+
<div class="rodape">
|
308
|
+
<div class="center">
|
309
|
+
<ul>
|
310
|
+
<li><strong>Menu institucional:</strong></li>
|
311
|
+
<li><a class="home" href="index.php">Página inicial</a>|</li>
|
312
|
+
<li><a class="conheca" href="conheca.php">Conheça o site</a>|</li>
|
313
|
+
<li><a class="consciente" href="consciente.php">Investimento Consciente</a>|</li>
|
314
|
+
<li><a class="contato" href="contato.php">Entre em contato</a>|</li>
|
315
|
+
<!--- <li><a class="assine" href="assine.php">Assine agora</a></li> --->
|
316
|
+
</ul>
|
317
|
+
<ul>
|
318
|
+
<li><strong>Menu software: </strong></li>
|
319
|
+
<li><a class="graficos" href="graficos.php?tipo=1">Gráficos</a>|</li>
|
320
|
+
<li><a class="detalhes" href="detalhes.php">Detalhes</a>|</li>
|
321
|
+
<li><a class="cotacoes" href="cotacoes.php">Histórico de cotações</a>|</li>
|
322
|
+
<li><a class="proventos" href="proventos.php">Proventos</a>|</li>
|
323
|
+
<li><a class="historicos" href="balancos.php">Balanços Históricos</a></li>
|
324
|
+
</ul>
|
325
|
+
</div>
|
326
|
+
</div>
|
327
|
+
<script type="text/javascript">
|
328
|
+
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
329
|
+
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
330
|
+
</script>
|
331
|
+
<script type="text/javascript">
|
332
|
+
var pageTracker = _gat._getTracker("UA-3584125-1");
|
333
|
+
pageTracker._initData();
|
334
|
+
pageTracker._trackPageview();
|
335
|
+
</script>
|
336
|
+
<!-- ClickTale Bottom part -->
|
337
|
+
<div id="ClickTale" style="display: none;"></div>
|
338
|
+
<script src="http://s.clicktale.net/WRa.js" type="text/javascript"></script>
|
339
|
+
<script type="text/javascript">
|
340
|
+
if(typeof ClickTale=='function') ClickTale(12450,0.25);
|
341
|
+
</script>
|
342
|
+
<!-- ClickTale end of Bottom part -->
|
343
|
+
</body>
|
344
|
+
</html>
|
345
|
+
|
@@ -0,0 +1,345 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2
|
+
<html lang="pt-br">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
5
|
+
<title>FUNDAMENTUS - VALE5 - Invista consciente - Indicadores Fundamentalistas</title>
|
6
|
+
|
7
|
+
<link rel="stylesheet" href="css/estilo.css" type="text/css" media="screen, projection">
|
8
|
+
<link rel="stylesheet" href="css/print.css" type="text/css" media="print">
|
9
|
+
<link rel="shortcut icon" href="img/fundamentus.ico" type="image/x-icon">
|
10
|
+
<!--[if lte IE 6]>
|
11
|
+
<link rel="stylesheet" type="text/css" href="css/menu_ie6.css">
|
12
|
+
<script type="text/javascript" src="script/ADxMenu.js"></script>
|
13
|
+
<![endif]-->
|
14
|
+
<script src="script/mootools.svn.js" type="text/javascript"></script>
|
15
|
+
<script type="text/javascript" src="script/Observer.js"></script>
|
16
|
+
<script type="text/javascript" src="script/Autocompleter.js"></script>
|
17
|
+
<script src="script/cmplte.php" type="text/javascript" language="JavaScript"></script>
|
18
|
+
|
19
|
+
<script src="script/tip.js" type="text/javascript" language="JavaScript"></script>
|
20
|
+
<script type="text/javascript">
|
21
|
+
function poApple() { }
|
22
|
+
</script>
|
23
|
+
|
24
|
+
</head>
|
25
|
+
<body class="detalhes">
|
26
|
+
<!-- ClickTale Top part -->
|
27
|
+
<script type="text/javascript">
|
28
|
+
var WRInitTime=(new Date()).getTime();
|
29
|
+
</script>
|
30
|
+
<!-- ClickTale end of Top part -->
|
31
|
+
|
32
|
+
<div class="center">
|
33
|
+
<div class="topo">
|
34
|
+
<a href="index.php"><img class="logo" src="img/logo.gif" alt="FUNDAMENTUS - Invista consciente"></a>
|
35
|
+
<div class="avancada"><a href="buscaavancada.php">Busca avançada por empresa</a></div>
|
36
|
+
<form class="busca" method="get" action="detalhes.php">
|
37
|
+
<fieldset>
|
38
|
+
<legend>Procurar por ação/empresa</legend>
|
39
|
+
<input class="texto" autocomplete="off" id="completar" name="papel" type="text"><input type="image" src="img/bt_exibir.jpg" class="botao" value="Exibir"><br>
|
40
|
+
</fieldset>
|
41
|
+
</form>
|
42
|
+
<div class="atual"><p>Você está vendo<strong>VALE5</strong></p></div> <div id="containerMenu">
|
43
|
+
<ul id="menu" class="institucional adxm menu">
|
44
|
+
<li><a class="home" href="index.php">Página inicial</a></li>
|
45
|
+
<!--- <li><a class="conheca" href="conheca.php">Conheça o sistema</a></li> --->
|
46
|
+
<li><a class="consciente" href="consciente.php">Investimento consciente</a></li>
|
47
|
+
<li><a class="contato" href="contato.php">Entre em contato</a></li>
|
48
|
+
</ul>
|
49
|
+
<ul id="menu" class="software adxm menu">
|
50
|
+
<li><a class="detalhes" href="detalhes.php">Detalhes</a></li>
|
51
|
+
<li><a class="graficos" onClick="poApple()" >Gráficos</a>
|
52
|
+
<ul>
|
53
|
+
<li><a href="graficos.php?papel=VALE5&tipo=1">Balanço patrimonial</a></li>
|
54
|
+
<li><a href="graficos.php?papel=VALE5&tipo=2">Demonstrativos de resultados</a></li>
|
55
|
+
<li><a href="graficos.php?papel=VALE5&tipo=3">Indicadores fundamentalistas</a></li>
|
56
|
+
</ul>
|
57
|
+
</li>
|
58
|
+
<li><a class="historicos" onClick="poApple()">Dados Históricos</a>
|
59
|
+
<ul class="provetos">
|
60
|
+
<li><a class="dh" href="balancos.php?papel=VALE5&tipo=1">Balanços em Excel</a></li>
|
61
|
+
<li><a class="dh" href="proventos.php?papel=VALE5&tipo=2">Proventos</a></li>
|
62
|
+
</ul>
|
63
|
+
</li>
|
64
|
+
<li><a class="cotacoes" href="cotacoes.php?papel=VALE5">Histórico de cotações</a></li>
|
65
|
+
</li>
|
66
|
+
</ul>
|
67
|
+
</div>
|
68
|
+
</div>
|
69
|
+
<div class="conteudo clearfix">
|
70
|
+
|
71
|
+
<div style="float: right; width: 180px;">
|
72
|
+
<script type="text/javascript"><!--
|
73
|
+
google_ad_client = "ca-pub-3119085269630402";
|
74
|
+
/* anuncioVerticalDireita */
|
75
|
+
google_ad_slot = "8411733769";
|
76
|
+
google_ad_width = 160;
|
77
|
+
google_ad_height = 600;
|
78
|
+
//-->
|
79
|
+
</script>
|
80
|
+
<script type="text/javascript"
|
81
|
+
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
82
|
+
</script>
|
83
|
+
</div>
|
84
|
+
<table class="w728">
|
85
|
+
<tr>
|
86
|
+
<td class="label w15"><span class="help tips" title="Código da ação">?</span><span class="txt">Papel</span></td>
|
87
|
+
<td class="data w35"><span class="txt">VALE5</span></td>
|
88
|
+
<td class="label destaque w2"><span class="help tips" title="Cotação de fechamento da ação no último pregão">?</span><span class="txt">Cotação</span></td>
|
89
|
+
<td class="data destaque w3"><span class="txt">29,48</span></td>
|
90
|
+
</tr>
|
91
|
+
<tr>
|
92
|
+
<td class="label"><span class="help tips" title="ON = Ordinária, PN = Preferencial, PNA = Pref. tipo A, etc">?</span><span class="txt">Tipo</span></td>
|
93
|
+
<td class="data"><span class="txt">PNA N1</span></td>
|
94
|
+
<td class="label"><span class="help tips" title="Data do último pregão em que o ativo foi negociado">?</span><span class="txt">Data últ cot</span></td>
|
95
|
+
<td class="data"><span class="txt">04/04/2014</span></td>
|
96
|
+
</tr>
|
97
|
+
<tr>
|
98
|
+
<td class="label"><span class="help tips" title="Nome comercial da empresa.">?</span><span class="txt">Empresa</span></td>
|
99
|
+
<td class="data"><span class="txt">CVRD PNA N1</span></td>
|
100
|
+
<td class="label"><span class="help tips" title="Menor cotação da ação nos últimos 12 meses.">?</span><span class="txt">Min 52 sem</span></td>
|
101
|
+
<td class="data"><span class="txt">25,25</span></td>
|
102
|
+
</tr>
|
103
|
+
<tr>
|
104
|
+
<td class="label"><span class="help tips" title="Classificação setorial">?</span><span class="txt">Setor</span></td>
|
105
|
+
<td class="data"><span class="txt"><a href="resultado.php?setor=2">Mineração</a></span></td>
|
106
|
+
<td class="label"><span class="help tips" title="Maior cotação da ação nos últimos 12 meses">?</span><span class="txt">Max 52 sem</span></td>
|
107
|
+
<td class="data"><span class="txt">34,44</span></td>
|
108
|
+
</tr>
|
109
|
+
<tr>
|
110
|
+
<td class="label"><span class="help tips" title="Classificação por segmento de atuação.">?</span><span class="txt">Subsetor</span></td>
|
111
|
+
<td class="data"><span class="txt"><a href="resultado.php?segmento=3">Minerais Metálicos</a></span></td>
|
112
|
+
<td class="label"><span class="help tips" title="Volume médio de negociação da ação nos últimos 2 meses (R$)">?</span><span class="txt">Vol $ méd (2m)</span></td>
|
113
|
+
<td class="data"><span class="txt">442.061.000</span></td>
|
114
|
+
</tr>
|
115
|
+
</table>
|
116
|
+
<table class="w728">
|
117
|
+
<tr>
|
118
|
+
<td class="label w2"><span class="help tips" title="Valor de mercado da empresa, calculado multiplicando o preço da ação pelo número total de ações.">?</span><span class="txt">Valor de mercado</span></td>
|
119
|
+
<td class="data w3"><span class="txt">158.169.000.000</span></td>
|
120
|
+
<td class="label w3"><span class="help tips" title="Data do último balanço divulgado pela empresa que consta no nosso banco de dados. Todos os indicadores são calculados considerando os últimos 12 meses finalizados na data deste balanço.">?</span><span class="txt">Últ balanço processado</span></td>
|
121
|
+
<td class="data w2"><span class="txt">31/12/2013</span></td>
|
122
|
+
</tr>
|
123
|
+
<tr>
|
124
|
+
<td class="label w2"><span class="help tips" title="Valor da firma (Enterprise Value) é calculado somando o valor de mercado da empresa a sua dívida líquida.">?</span><span class="txt">Valor da firma</span></td>
|
125
|
+
<td class="data w3"><span class="txt">214.681.000.000</span></td>
|
126
|
+
<td class="label"><span class="help tips" title="Número total de ações, somadas todas as espécies: ON, PN, etc">?</span><span class="txt">Nro. Ações</span></td>
|
127
|
+
<td class="data"><span class="txt">5.365.300.000</span></td>
|
128
|
+
</tr>
|
129
|
+
</table>
|
130
|
+
<table class="w728">
|
131
|
+
<tr>
|
132
|
+
<td class="nivel1" colspan="2"><span class="txt">Oscilações</span></td>
|
133
|
+
<td class="nivel1" colspan="4"><span class="txt">Indicadores fundamentalistas</span></td>
|
134
|
+
</tr>
|
135
|
+
<tr>
|
136
|
+
<td class="label w1"><span class="txt">Dia</span></td>
|
137
|
+
<td class="data w1"><span class="oscil"><font color="#F75D59">-0,24%</font></span></td>
|
138
|
+
<td class="label w2"><span class="help tips" title="Preço da ação dividido pelo lucro por ação. O P/L é o número de anos que se levaria para reaver o capital aplicado na compra de uma ação, através do recebimento do lucro gerado pela empresa, considerando que esses lucros permaneçam constantes.">?</span><span class="txt">P/L</span></td>
|
139
|
+
<td class="data w2"><span class="txt">1.374,30</span></td>
|
140
|
+
<td class="label w2"><span class="help tips" title="Lucro por Ação">?</span><span class="txt">LPA</span></td>
|
141
|
+
<td class="data w2"><span class="txt">0,02</span></td>
|
142
|
+
</tr>
|
143
|
+
<tr>
|
144
|
+
<td class="label w1"><span class="txt">Mês</span></td>
|
145
|
+
<td class="data w1"><span class="oscil"><font color="#306EFF">6,01%</font></span></td>
|
146
|
+
<td class="label w2"><span class="help tips" title="Preço da ação dividido pelo Valor Patrimonial por ação. Informa quanto o mercado está disposto a pagar sobre o Patrimônio Líquido da empresa">?</span><span class="txt">P/VP</span></td>
|
147
|
+
<td class="data w2"><span class="txt">1,07</span></td>
|
148
|
+
<td class="label w2"><span class="help tips" title="Valor Patrimonial por Ação: Valor do Patrimônio Líquido dividido pelo número total de ações.">?</span><span class="txt">VPA</span></td>
|
149
|
+
<td class="data w2"><span class="txt">27,65</span></td>
|
150
|
+
</tr>
|
151
|
+
<tr>
|
152
|
+
<td class="label w1"><span class="txt">30 dias</span></td>
|
153
|
+
<td class="data w1"><span class="oscil"><font color="#306EFF">1,34%</font></span></td>
|
154
|
+
<td class="label w2"><span class="help tips" title="Preço da ação dividido pelo EBIT por ação. EBIT é o Lucro antes dos Impostos e Despesas Financeiras. É uma boa aproximação do lucro operacional da empresa.">?</span><span class="txt">P/EBIT</span></td>
|
155
|
+
<td class="data w2"><span class="txt">
|
156
|
+
3,43</span></td>
|
157
|
+
<td class="label"><span class="help tips" title="Lucro Bruto dividido pela Receita Líquida: Indica a porcentagem de cada R$1 de venda que sobrou após o custo dos produtos/serviços vendidos">?</span><span class="txt">Marg. Bruta</span></td>
|
158
|
+
<td class="data"><span class="txt">
|
159
|
+
48,3%</span></td>
|
160
|
+
</tr>
|
161
|
+
<tr>
|
162
|
+
<td class="label w1"><span class="txt">12 meses</span></td>
|
163
|
+
<td class="data w1"><span class="oscil"><font color="#F75D59">-7,35%</font></span></td>
|
164
|
+
<td class="label"><span class="help tips" title="Price Sales Ratio: Preço da ação dividido pela Receita Líquida por ação">?</span><span class="txt">PSR</span></td>
|
165
|
+
<td class="data"><span class="txt">
|
166
|
+
1,56</span></td>
|
167
|
+
<td class="label"><span class="help tips" title="EBIT dividido pela Receita Líquida: Indica a porcentagem de cada R$1 de venda que sobrou após o pagamento dos custos dos produtos/serviços vendidos, das despesas com vendas, gerais e administrativas">?</span><span class="txt">Marg. EBIT</span></td>
|
168
|
+
<td class="data"><span class="txt">
|
169
|
+
45,5%</span></td>
|
170
|
+
</tr>
|
171
|
+
<tr>
|
172
|
+
<td class="label w1"><span class="txt">2014</span></td>
|
173
|
+
<td class="data w1"><span class="oscil"><font color="#F75D59">-9,93%</font></span></td>
|
174
|
+
<td class="label w2"><span class="help tips" title="Preço da ação dividido pelos Ativos totais por ação.">?</span><span class="txt">P/Ativos</span></td>
|
175
|
+
<td class="data w2"><span class="txt">
|
176
|
+
0,54</span></td>
|
177
|
+
<td class="label"><span class="help tips" title="Lucro Líquido dividido pela Receita Líquida">?</span><span class="txt">Marg. Líquida</span></td>
|
178
|
+
<td class="data"><span class="txt">
|
179
|
+
-0,3%</span></td>
|
180
|
+
</tr>
|
181
|
+
<tr>
|
182
|
+
<td class="label w1"><span class="txt">2013</span></td>
|
183
|
+
<td class="data w1"><span class="oscil"><font color="#F75D59">-15,21%</font></span></td>
|
184
|
+
<td class="label w2"><span class="help tips" title="Preço da ação dividido pelo capital de giro por ação. Capital de giro é o Ativo Circulante menos Passivo Circulante">?</span><span class="txt">P/Cap. Giro</span></td>
|
185
|
+
<td class="data w2"><span class="txt">
|
186
|
+
4,57</span></td>
|
187
|
+
<td class="label"><span class="help tips" title="EBIT dividido por Ativos totais">?</span><span class="txt">EBIT / Ativo</span></td>
|
188
|
+
<td class="data"><span class="txt">15,8%</span></td>
|
189
|
+
</tr>
|
190
|
+
<tr>
|
191
|
+
<td class="label w1"><span class="txt">2012</span></td>
|
192
|
+
<td class="data w1"><span class="oscil"><font color="#306EFF">14,61%</font></span></td>
|
193
|
+
<td class="label w2"><span class="help tips" title="Preço da ação dividido pelos Ativos Circulantes Líquidos por ação. Ativo Circ. Líq. é obtido subtraindo os ativos circulantes pelas dívidas de curto e longo prazo, ou seja, após o pagamento de todas as dívidas, quanto sobraria dos ativos mais líquidos da empresa (caixa, estoque, etc)">?</span><span class="txt">P/Ativ Circ Liq</span></td>
|
194
|
+
<td class="data w2"><span class="txt">
|
195
|
+
-1,91</span></td>
|
196
|
+
<td class="label"><span class="help tips" title="Retorno sobre o Capital Investido: Calculado dividindo-se o EBIT por (Ativos - Fornecedores - Caixa). Informa o retorno que a empresa consegue sobre o capital total aplicado.">?</span><span class="txt">ROIC</span></td>
|
197
|
+
<td class="data"><span class="txt">
|
198
|
+
17,1%</span></td>
|
199
|
+
</tr>
|
200
|
+
<tr>
|
201
|
+
<td class="label w1"><span class="txt">2011</span></td>
|
202
|
+
<td class="data w1"><span class="oscil"><font color="#F75D59">-16,51%</font></span></td>
|
203
|
+
<td class="label"><span class="help tips" title="Dividend Yield: Dividendo pago por ação dividido pelo preço da ação. É o rendimento gerado para o dono da ação pelo pagamento de dividendos.">?</span><span class="txt">Div. Yield</span></td>
|
204
|
+
<td class="data"><span class="txt">6,1%</span></td>
|
205
|
+
<td class="label"><span class="help tips" title="Retorno sobre o Patrimônio Líquido: Lucro líquido dividido pelo Patrimônio Líquido">?</span><span class="txt">ROE</span></td>
|
206
|
+
<td class="data"><span class="txt">
|
207
|
+
0,1%</span></td>
|
208
|
+
</tr>
|
209
|
+
<tr>
|
210
|
+
<td class="label w1"><span class="txt">2010</span></td>
|
211
|
+
<td class="data w1"><span class="oscil"><font color="#306EFF">17,23%</font></span></td>
|
212
|
+
<td class="label"><span class="help tips" title="Valor da Firma (Enterprise Value dividido pelo EBIT.">?</span><span class="txt">EV / EBIT</span></td>
|
213
|
+
<td class="data"><span class="txt">
|
214
|
+
4,65</span></td>
|
215
|
+
<td class="label"><span class="help tips" title="Ativo Circulante dividido pelo Passivo Circulante: Reflete a capacidade de pagamento da empresa no curto prazo.">?</span><span class="txt">Liquidez Corr</span></td>
|
216
|
+
<td class="data"><span class="txt">
|
217
|
+
2,54</span></td>
|
218
|
+
</tr>
|
219
|
+
<tr>
|
220
|
+
<td class="label w1"><span class="txt">2009</span></td>
|
221
|
+
<td class="data w1"><span class="oscil"><font color="#306EFF">66,07%</font></span></td>
|
222
|
+
<td class="label"><span class="help tips" title="Receita Líquida dividido por Ativos Totais. Indica a eficiência com a qual a empresa usa seus ativos para gerar vendas">?</span><span class="txt">Giro Ativos</span></td>
|
223
|
+
<td class="data"><span class="txt">
|
224
|
+
0,35</span></td>
|
225
|
+
<td class="label"><span class="help tips" title="Dívida Bruta total (Dívida+Debêntures) dividido pelo Patrimônio Líquido">?</span><span class="txt">Div Br/ Patrim</span></td>
|
226
|
+
<td class="data"><span class="txt">
|
227
|
+
0,46</span></td>
|
228
|
+
</tr>
|
229
|
+
<tr>
|
230
|
+
<td class="label w1"><span class="txt"></span></td>
|
231
|
+
<td class="data w1"><span class="oscil"></span></td>
|
232
|
+
<td class="label"><span class="help tips" title="Crescimento da Receita Líquida nos últimos 5 anos">?</span><span class="txt">Cres. Rec (5a)</span></td>
|
233
|
+
<td class="data"><span class="txt">
|
234
|
+
17,3%</span></td>
|
235
|
+
<td class="label"><span class="txt"></span></td>
|
236
|
+
<td class="data"><span class="txt"></span></td>
|
237
|
+
</tr>
|
238
|
+
</table>
|
239
|
+
|
240
|
+
<table class="w728">
|
241
|
+
<tr>
|
242
|
+
<td class="nivel1" colspan="4"><span class="txt">Dados Balanço Patrimonial</span></td>
|
243
|
+
</tr>
|
244
|
+
<tr>
|
245
|
+
<td class="label w2"><span class="help tips" title="Todos os bens, direitos e valores a receber de uma entidade">?</span><span class="txt">Ativo</span></td>
|
246
|
+
<td class="data w3"><span class="txt">291.880.000.000</span></td>
|
247
|
+
<td class="label w2"><span class="help tips" title="Dívida Bruta é obtida somando-se as dívidas de curto e longo prazo mais as debêntures de curto e longo prazo.">?</span><span class="txt">Dív. Bruta</span></td>
|
248
|
+
<td class="data w3"><span class="txt">68.977.000.000</span></td>
|
249
|
+
</tr>
|
250
|
+
<tr>
|
251
|
+
<td class="label"><span class="help tips" title="Contas que representam bens numerários (Dinheiro)">?</span><span class="txt">Disponibilidades</span></td>
|
252
|
+
<td class="data"><span class="txt">12.465.200.000</span></td>
|
253
|
+
<td class="label"><span class="help tips" title="Dívida Bruta menos Disponibilidades. Se este valor é negativo, significa que a empresa possui caixa líquido positivo.">?</span><span class="txt">Dív. Líquida</span></td>
|
254
|
+
<td class="data"><span class="txt">56.511.800.000</span></td>
|
255
|
+
</tr>
|
256
|
+
<tr>
|
257
|
+
<td class="label"><span class="help tips" title="Bens ou direitos que podem ser convertido em dinheiro em curto prazo">?</span><span class="txt">Ativo Circulante</span></td>
|
258
|
+
<td class="data"><span class="txt">57.104.700.000</span></td>
|
259
|
+
<td class="label"><span class="help tips" title="O patrimônio líquido representa os valores que os sócios ou acionistas têm na empresa em um determinado momento. No balanço patrimonial, a diferença entre o valor dos ativos e dos passivos e resultado de exercícios futuros representa o PL (Patrimônio Líquido), que é o valor contábil devido pela pessoa jurídica aos sócios ou acionistas.">?</span><span class="txt">Patrim. Líq</span></td>
|
260
|
+
<td class="data"><span class="txt">148.346.000.000</span></td>
|
261
|
+
</tr>
|
262
|
+
</table>
|
263
|
+
|
264
|
+
<table class="w728">
|
265
|
+
<tr>
|
266
|
+
<td class="nivel1" colspan="4"><span class="txt">Dados demonstrativos de resultados</span></td>
|
267
|
+
</tr>
|
268
|
+
<tr>
|
269
|
+
<td class="nivel2 w5" colspan="2"><span class="txt">Últimos 12 meses</span></td>
|
270
|
+
<td class="nivel2 w5" colspan="2"><span class="txt">Últimos 3 meses</span></td>
|
271
|
+
</tr>
|
272
|
+
<tr>
|
273
|
+
<td class="label w2" ><span class="help tips" title="Receita Líquida é a soma de todas as vendas da empresa em determinado período deduzido de devoluções, descontos e alguns impostos.">?</span><span class="txt">Receita Líquida</span></td>
|
274
|
+
<td class="data w3"><span class="txt">101.490.000.000</span></td>
|
275
|
+
<td class="label w2"><span class="help tips" title="Receita Líquida é a soma de todas as vendas da empresa em determinado período deduzido de devoluções, descontos e alguns impostos.">?</span><span class="txt">Receita Líquida</span></td>
|
276
|
+
<td class="data w3"><span class="txt">28.626.200.000</span></td>
|
277
|
+
</tr>
|
278
|
+
<tr>
|
279
|
+
<td class="label"><span class="help tips" title="Earnings Before Interest and Taxes - Lucro antes dos impostos e juros: Uma aproximação do lucro operacional da empresa.">?</span><span class="txt">EBIT</span></td>
|
280
|
+
<td class="data"><span class="txt">46.175.100.000</span></td>
|
281
|
+
<td class="label"><span class="help tips" title="Earnings Before Interest and Taxes - Lucro antes dos impostos e juros: Uma aproximação do lucro operacional da empresa.">?</span><span class="txt">EBIT</span></td>
|
282
|
+
<td class="data"><span class="txt">14.007.500.000</span></td>
|
283
|
+
</tr>
|
284
|
+
<tr>
|
285
|
+
<td class="label"><span class="help tips" title="O que sobra das vendas após o todas as despesas.">?</span><span class="txt">Lucro Líquido</span></td>
|
286
|
+
<td class="data"><span class="txt">115.091.000</span></td>
|
287
|
+
<td class="label"><span class="help tips" title="O que sobra das vendas após o todas as despesas.">?</span><span class="txt">Lucro Líquido</span></td>
|
288
|
+
<td class="data"><span class="txt">-14.867.100.000</span></td>
|
289
|
+
</tr>
|
290
|
+
</table>
|
291
|
+
<BR>
|
292
|
+
<script type="text/javascript"><!--
|
293
|
+
google_ad_client = "ca-pub-3119085269630402";
|
294
|
+
/* anuncioRodape */
|
295
|
+
google_ad_slot = "1513786315";
|
296
|
+
google_ad_width = 728;
|
297
|
+
google_ad_height = 90;
|
298
|
+
//-->
|
299
|
+
</script>
|
300
|
+
<script type="text/javascript"
|
301
|
+
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
302
|
+
</script>
|
303
|
+
|
304
|
+
|
305
|
+
</div>
|
306
|
+
</div>
|
307
|
+
<div class="rodape">
|
308
|
+
<div class="center">
|
309
|
+
<ul>
|
310
|
+
<li><strong>Menu institucional:</strong></li>
|
311
|
+
<li><a class="home" href="index.php">Página inicial</a>|</li>
|
312
|
+
<li><a class="conheca" href="conheca.php">Conheça o site</a>|</li>
|
313
|
+
<li><a class="consciente" href="consciente.php">Investimento Consciente</a>|</li>
|
314
|
+
<li><a class="contato" href="contato.php">Entre em contato</a>|</li>
|
315
|
+
<!--- <li><a class="assine" href="assine.php">Assine agora</a></li> --->
|
316
|
+
</ul>
|
317
|
+
<ul>
|
318
|
+
<li><strong>Menu software: </strong></li>
|
319
|
+
<li><a class="graficos" href="graficos.php?tipo=1">Gráficos</a>|</li>
|
320
|
+
<li><a class="detalhes" href="detalhes.php">Detalhes</a>|</li>
|
321
|
+
<li><a class="cotacoes" href="cotacoes.php">Histórico de cotações</a>|</li>
|
322
|
+
<li><a class="proventos" href="proventos.php">Proventos</a>|</li>
|
323
|
+
<li><a class="historicos" href="balancos.php">Balanços Históricos</a></li>
|
324
|
+
</ul>
|
325
|
+
</div>
|
326
|
+
</div>
|
327
|
+
<script type="text/javascript">
|
328
|
+
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
329
|
+
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
330
|
+
</script>
|
331
|
+
<script type="text/javascript">
|
332
|
+
var pageTracker = _gat._getTracker("UA-3584125-1");
|
333
|
+
pageTracker._initData();
|
334
|
+
pageTracker._trackPageview();
|
335
|
+
</script>
|
336
|
+
<!-- ClickTale Bottom part -->
|
337
|
+
<div id="ClickTale" style="display: none;"></div>
|
338
|
+
<script src="http://s.clicktale.net/WRa.js" type="text/javascript"></script>
|
339
|
+
<script type="text/javascript">
|
340
|
+
if(typeof ClickTale=='function') ClickTale(12450,0.25);
|
341
|
+
</script>
|
342
|
+
<!-- ClickTale end of Bottom part -->
|
343
|
+
</body>
|
344
|
+
</html>
|
345
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require_relative './config.rb'
|
2
|
+
|
3
|
+
class FundamentusAcceptanceTest < Minitest::Test
|
4
|
+
|
5
|
+
def test_save_financial_data
|
6
|
+
|
7
|
+
stocks = {
|
8
|
+
'PETR4' => { json_path: TEST_DIR + 'output/PETR4.json', json: petr4_json },
|
9
|
+
'VALE5' => { json_path: TEST_DIR + 'output/VALE5.json', json: vale5_json }
|
10
|
+
}
|
11
|
+
|
12
|
+
stocks.each do |code, info|
|
13
|
+
File.unlink(info[:json_path]) unless not File.exists?(info[:json_path])
|
14
|
+
end
|
15
|
+
|
16
|
+
html_fetcher = LocalFileFetcher.new(TEST_DIR + 'data/')
|
17
|
+
file_manager = FileManager.new(TEST_DIR + 'output/')
|
18
|
+
parser = FundamentusParser.new
|
19
|
+
|
20
|
+
pages = FundamentusFetcher.new(html_fetcher).fetch(stocks.keys)
|
21
|
+
|
22
|
+
pages.each do |key, content|
|
23
|
+
file_manager.save(key + '.json', parser.parse(content).to_json)
|
24
|
+
end
|
25
|
+
|
26
|
+
stocks.each do |code, info|
|
27
|
+
assert_equal info[:json], File.open(info[:json_path]).read
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def petr4_json
|
35
|
+
'{"share_count":"13.044.500.000","market_cap":"201.407.000.000","last_processed":"31/12/2013","pl":"8,54","pvp":"0,58","pebit":"4,04","lpa":"1,81","vpa":"26,67","net_margin":"7,5%","net_debt":"221.549.000.000","net_assets":"347.940.000.000","yearly_net_income":"304.890.000.000","yearly_net_profit":"23.570.400.000","quarterly_net_income":"81.028.000.000","quarterly_net_profit":"6.281.530.000"}'
|
36
|
+
end
|
37
|
+
|
38
|
+
def vale5_json
|
39
|
+
'{"share_count":"5.365.300.000","market_cap":"158.169.000.000","last_processed":"31/12/2013","pl":"1.374,30","pvp":"1,07","pebit":"3,43","lpa":"0,02","vpa":"27,65","net_margin":"-0,3%","net_debt":"56.511.800.000","net_assets":"148.346.000.000","yearly_net_income":"101.490.000.000","yearly_net_profit":"115.091.000","quarterly_net_income":"28.626.200.000","quarterly_net_profit":"-14.867.100.000"}'
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require_relative './config.rb'
|
2
|
+
|
3
|
+
class FundamentusFetcherTest < Minitest::Test
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@url_fetcher = MiniTest::Mock.new
|
7
|
+
@fundamentus_fetcher = FundamentusFetcher.new(@url_fetcher)
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_fetching_page_with_code_as_string
|
11
|
+
code = 'VALE5'
|
12
|
+
args = { code => 'http://www.fundamentus.com.br/detalhes.php?papel=' + code }
|
13
|
+
@url_fetcher.expect :fetch, nil, [args]
|
14
|
+
@fundamentus_fetcher.fetch(code)
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_fetching_page_with_array_of_codes
|
18
|
+
stock_codes = ['VALE5', 'PETR4', 'ITUB4']
|
19
|
+
args = {}
|
20
|
+
stock_codes.each do |code|
|
21
|
+
args[code] = 'http://www.fundamentus.com.br/detalhes.php?papel=' + code
|
22
|
+
end
|
23
|
+
@url_fetcher.expect :fetch, nil, [args]
|
24
|
+
@fundamentus_fetcher.fetch(stock_codes)
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require_relative './config.rb'
|
2
|
+
|
3
|
+
class FundamentusParserTest < Minitest::Test
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@parser = FundamentusParser.new
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_parse_valid_file
|
10
|
+
load_valid_file
|
11
|
+
assert_equal '5.365.300.000', @parsed[:share_count]
|
12
|
+
assert_equal '158.169.000.000', @parsed[:market_cap]
|
13
|
+
assert_equal '31/12/2013', @parsed[:last_processed]
|
14
|
+
assert_equal '1.374,30', @parsed[:pl]
|
15
|
+
assert_equal '1,07', @parsed[:pvp]
|
16
|
+
assert_equal '3,43', @parsed[:pebit]
|
17
|
+
assert_equal '0,02', @parsed[:lpa]
|
18
|
+
assert_equal '27,65', @parsed[:vpa]
|
19
|
+
assert_equal '-0,3%', @parsed[:net_margin]
|
20
|
+
assert_equal '56.511.800.000', @parsed[:net_debt]
|
21
|
+
assert_equal '148.346.000.000', @parsed[:net_assets]
|
22
|
+
assert_equal '101.490.000.000', @parsed[:yearly_net_income]
|
23
|
+
assert_equal '115.091.000', @parsed[:yearly_net_profit]
|
24
|
+
assert_equal '28.626.200.000', @parsed[:quarterly_net_income]
|
25
|
+
assert_equal '-14.867.100.000', @parsed[:quarterly_net_profit]
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_parse_invalid_file
|
29
|
+
load_invalid_file
|
30
|
+
assert_nil @parsed[:share_count]
|
31
|
+
assert_nil @parsed[:market_cap]
|
32
|
+
assert_nil @parsed[:last_processed]
|
33
|
+
assert_nil @parsed[:pl]
|
34
|
+
assert_nil @parsed[:pvp]
|
35
|
+
assert_nil @parsed[:pebit]
|
36
|
+
assert_nil @parsed[:lpa]
|
37
|
+
assert_nil @parsed[:vpa]
|
38
|
+
assert_nil @parsed[:net_margin]
|
39
|
+
assert_nil @parsed[:net_debt]
|
40
|
+
assert_nil @parsed[:net_assets]
|
41
|
+
assert_nil @parsed[:yearly_net_income]
|
42
|
+
assert_nil @parsed[:yearly_net_profit]
|
43
|
+
assert_nil @parsed[:quarterly_net_income]
|
44
|
+
assert_nil @parsed[:quarterly_net_profit]
|
45
|
+
end
|
46
|
+
|
47
|
+
def load_valid_file
|
48
|
+
@page = File.open(File.expand_path('vale5.html', File.dirname(__FILE__) + '/data/')).read
|
49
|
+
@parsed = @parser.parse(@page)
|
50
|
+
end
|
51
|
+
|
52
|
+
def load_invalid_file
|
53
|
+
@page = '<html>';
|
54
|
+
@parsed = @parser.parse(@page)
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class LocalFileFetcher
|
2
|
+
def initialize(dir_path, file_ext = '.html')
|
3
|
+
@dir_path = dir_path
|
4
|
+
@file_ext = file_ext
|
5
|
+
end
|
6
|
+
|
7
|
+
def fetch(urls)
|
8
|
+
response = {}
|
9
|
+
urls.each do |key, url|
|
10
|
+
path = @dir_path + "#{key}" + @file_ext
|
11
|
+
if File.readable?(path)
|
12
|
+
response[key] = File.read(path)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
response
|
16
|
+
end
|
17
|
+
end
|
data/test/output/.keep
ADDED
File without changes
|
metadata
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fundamentus_data
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Vinicius Pinto
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-04-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: nokogiri
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: minitest
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '5.5'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '5.5'
|
41
|
+
description: Fundamentus.com.br is a brazilian site that provides financial information
|
42
|
+
about companies listed in Bovespa (the brazilian stock market). This gem can be
|
43
|
+
used to save data from specified stocks in JSON format for later processing.
|
44
|
+
email: contact@codense.com
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- ".gitignore"
|
50
|
+
- Gemfile
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- fundamentus_data.gemspec
|
54
|
+
- lib/fundamentus_data.rb
|
55
|
+
- lib/fundamentus_data/fundamentus_data.rb
|
56
|
+
- lib/fundamentus_data/fundamentus_fetcher.rb
|
57
|
+
- lib/fundamentus_data/fundamentus_parser.rb
|
58
|
+
- lib/fundamentus_data/util/file_manager.rb
|
59
|
+
- lib/fundamentus_data/util/url_fetcher.rb
|
60
|
+
- test/config.rb
|
61
|
+
- test/data/petr4.html
|
62
|
+
- test/data/vale5.html
|
63
|
+
- test/fundamentus_acceptance_test.rb
|
64
|
+
- test/fundamentus_fetcher_test.rb
|
65
|
+
- test/fundamentus_parser_test.rb
|
66
|
+
- test/lib/local_file_fetcher.rb
|
67
|
+
- test/output/.keep
|
68
|
+
homepage: http://github.com/viniciuspinto/fundamentus
|
69
|
+
licenses:
|
70
|
+
- MIT
|
71
|
+
metadata: {}
|
72
|
+
post_install_message:
|
73
|
+
rdoc_options: []
|
74
|
+
require_paths:
|
75
|
+
- lib
|
76
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
requirements: []
|
87
|
+
rubyforge_project:
|
88
|
+
rubygems_version: 2.4.6
|
89
|
+
signing_key:
|
90
|
+
specification_version: 4
|
91
|
+
summary: Save brazilian stock data from the Fundamentus site in JSON format
|
92
|
+
test_files:
|
93
|
+
- test/config.rb
|
94
|
+
- test/data/petr4.html
|
95
|
+
- test/data/vale5.html
|
96
|
+
- test/fundamentus_acceptance_test.rb
|
97
|
+
- test/fundamentus_fetcher_test.rb
|
98
|
+
- test/fundamentus_parser_test.rb
|
99
|
+
- test/lib/local_file_fetcher.rb
|
100
|
+
- test/output/.keep
|