Pra que complicar processando o HTML? O site atualiza esse "chart" a partir de um JSON:<br><a href="http://cotacoes.economia.uol.com.br/ws/asset/687/intraday?size=50&callback=uolfinancecallback0&page=1">http://cotacoes.economia.uol.com.br/ws/asset/687/intraday?size=50&callback=uolfinancecallback0&page=1</a><br clear="all">
A estrutura é:<br><br><font size="1"><span style="font-family: courier new,monospace;">uolfinancecallback0({</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> "data": [</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> "date": 1296149460000,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> "price": 52.1,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> "low": 51.96,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> "high": 52.82,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> "var": -0.36,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> "varpct": -0.69,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> "vol": 6194139.0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> },</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">(...)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> "date": 1296146520000,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> "price": 52.07,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> "low": 51.96,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> "high": 52.82,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> "var": -0.39,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> "varpct": -0.74,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> "vol": 5584075.0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> ],</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> "total": 265,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> "lastUpdate": 1296149460000,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> "type": "stock",</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> "timeOffSet": -7200000,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> "today": 1296150408637</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">});</span><br style="font-family: courier new,monospace;"></font><br>Para processar JSON com Perl: <a href="http://search.cpan.org/~mlehmann/JSON-XS-2.3/XS.pm">http://search.cpan.org/~mlehmann/JSON-XS-2.3/XS.pm</a><br>
<br>ABS()<br><br>
<br><br><div class="gmail_quote">2011/1/27 Gabriel Andrade <span dir="ltr"><<a href="mailto:gabiruh@gmail.com">gabiruh@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5"><br>
On Jan 27, 2011, at 2:11 PM, Jose Roberto Aquino wrote:<br>
<br>
> Pessoal, alguém pode me ajudar na orientação de como capturar dados desse site:<br>
> <a href="http://economia.uol.com.br/cotacoes/bolsas/acoes/bvsp-bovespa/vale5-sa/tabela-intraday.jhtm?size=700" target="_blank">http://economia.uol.com.br/cotacoes/bolsas/acoes/bvsp-bovespa/vale5-sa/tabela-intraday.jhtm?size=700</a><br>
><br>
> Após capturar objetivo é guardá-los no mysql.<br>
<br>
</div></div>Alguém já teve mesma necessidade que a sua e fez o grande favor de disponibilizar no CPAN.<br>
E aposto que a solução pra 90% dos seus outros futuros problemas pode ser econtrada lá, excetuando-se gravidez indesejada, conjuntivite e nome sujo no SPC.<br>
<br>
<a href="http://search.cpan.org/perldoc?Finance::YahooQuote" target="_blank">http://search.cpan.org/perldoc?Finance::YahooQuote</a><br>
<br>
Dá uma olhada na subrotina getcustomquote pra poder especificar quais campos você deseja obter informação.<br>
<br>
$ curl -L <a href="http://cpanmin.us" target="_blank">cpanmin.us</a> | perl - Finance::YahooQuote<br>
$ perl -MFinance::YahooQuote=getquote -MData::Dumper=Dumper -E 'say Dumper getquote(qw/<a href="http://VALE5.SA/%29" target="_blank">VALE5.SA/)</a>;'<br>
<div><div></div><div class="h5"><br>
<br>
=begin disclaimer<br>
Sao Paulo Perl Mongers: <a href="http://sao-paulo.pm.org/" target="_blank">http://sao-paulo.pm.org/</a><br>
SaoPaulo-pm mailing list: <a href="mailto:SaoPaulo-pm@pm.org">SaoPaulo-pm@pm.org</a><br>
L<<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a>><br>
=end disclaimer<br>
</div></div></blockquote></div><br>