Get information from a page generated by JS with PHP

-1

I have this page that is on a server where I do not have access. link Open it in the browser and see that your jquery generates a number.

I'm trying to get the number it generates but when I use this function:

$page = file_get_contents('http://genuncoin.com/crypto/');

$page returns the html of it without the number only the javas scripts and html of the screen. would anyone know how to get the value that is generated by javascript ??

    
asked by anonymous 02.02.2018 / 16:09

1 answer

0

The characters being generated are in the balancebig variable and it is displayed on the screen as follows:

$('#bnkPrice').text(balancebig);

As you want to retrieve information from this variable, I suggest you make an ajax request by sending the contents of this variable to your PHP script. An example of how you could do this is as follows:

$.ajax({
    url: 'script.php',
    method: 'post',
    data: {variavel: balancebig},

    success: function(data, textStatus, jqXHR) {
        alert('Caracteres enviados');
    }
});

In your file (which for example I'm using script.php you can retrieve the value using the superglobal post, as you would normally do:

$dado = $_POST['variavel'];
    
02.02.2018 / 16:27