Is there any way to retrieve updated HTML using DOM? The original HTML page is from a remote site, which does not have internal access, and it looks like this:
<div class="content" id="content">
loading
</div>
When we click on a button within the page, javascript
acts, and div
is modified, getting something like:
<div class="content" id="content">
<span class="values">text1</span>
<span class="values">text2</span>
</div>
I need to retrieve the texts of tags <span>
, which in this case was javascript
who inserted it. I used DOM:
$html = file_get_contents("http://sitetal.com");
$DOM = new DOMDocument();
$DOM->loadHTML($html);
$xpath = new DomXpath($DOM);
$span = $xpath->query('//*[contains(concat(" ", normalize-space(@class), " "), "values")]');
foreach($span as $spanvalue){
$sp = floatval($spanvalue[0]->nodeValue);
$spaValue = $sp;
echo $spaValue;
}
But of course nothing is returned to me because <span>
has not yet been created, it will only be created when the button is clicked on the site, and javascript
insert the information. is there any way to retrieve the updated HTML, to read the values that were generated in <span>
?
For me to retrieve the text 1 and text 2.?