1
Well the doubt I have is this, I need to get the following excerpt of HTML right below:
HTML:
<section class="ovw-summary">
<div class="ovw-summary__balance balance-amounts">
<header><h3>Meu dinheiro</h3></header>
<div class="box-container mp-box-shadow bg-trama">
<dl class="balance-amounts__list available-money">
<dt>Disponível</dt>
<dd class="price price-large mlb">
<span class="price-symbol">R$</span> <span class="price-integer">0</span><span class="price-decimal-mark">,</span><span class="price-decimal">00</span>
</dd>
</dl>
<dl class="balance-amounts__list account-money">
<dt>Em conta</dt>
<dd class="price">
<span class="price-symbol">R$</span> <span class="price-integer">24</span><span class="price-decimal-mark">,</span><span class="price-decimal">99</span>
</dd>
</dl>
I did this way to read the HTML and returns the correct data. Here my code in PHP I did a regex see how it is:
$SaldoEmConta = '~<dl class="account-money">\s*<dt>Em conta<\/dt>\s*<dd class="ch-price" name="balance_total" value=".*?">R\$ (.*?)<sup>(.*?)<\/sup>\s*<a href=".*?" class="icon-info-balance">\s*<i class="ch-icon-help-sign">\s*<\/i>\s*<\/a>\s*<\/dd>\s*<\/dl>~';
preg_match($SaldoEmConta, $RetornoSaldo, $ArrayConta);
$SaldoDisponivel = '~<dl class="open-detail">\s*<dt class="available-label">Disponível<\/dt>\s*<dd class="ch-price available-price" name="balance_available" value=".*">R\$ (.*?)<sup>(.*?)<\/sup>\s*<\/dd>~';
preg_match($SaldoEmConta, $RetornoSaldo, $ArrayDisponivel);
echo 'Em conta: R$ ' . $ArrayConta[1].','.$ArrayConta[2] . ' Disponivel: R$ ' . $ArrayDisponivel[1].','.$ArrayDisponivel[2] .'<hr>';
But for some reason I can’t get hold of those values someone can help me correct my regular expression?
You’re opening HTML on the server side and you want to change that HTML to upload to the client side, is that it? You can explain better what you want to do and where this HTML comes from?
– Sergio
After accessing by precise Curl takes these values in the html that returns .
– Rafael norton
Working HTML in PHP via Regexp is unreliable... you can’t get this data in another JSON format?
– Sergio
No da , before they update the layout of the site where access to search the value was returning me normally data.
– Rafael norton