Asked by duncanb7
at 2024-06-17 08:13:41
Point:500 Replies:8 POST_ID:828559USER_ID:11059
Topic:
Apache Web Server;PHP Scripting Language;JavaScript
I would like to get the html DOM data from the follwing simple HTML page which
just output "after " to div tag at id="txt" after the body onload from javascript
function init() done
I use curl php with $dom.getElementById("txt")->nodeValue to extract
"after" but it just echo out"before" (at div tag) which is the value before excuting
javascript init() on body onload, Why ?
On FireFox firebug, we can see the complete javascript code is done and output
the "after" data when view the page source.
COuld we use php curl to extract the DOM data after parsing all javascript coding
and function execution is completed on the html web page.
I try $dom->validateOnParse = true; but it is still not working.
If we can see the "after" data on my IE broswer, we should be able to extract it
from curl php like browser's view source option , Right ?
Please advise
Duncan
<?php
include "include'/curl.php";
$url="http://www.mysite.com/simple.html";
$file_url=my_curl($url,"" , 7, TRUE,2,"");
}
if ($file_url) {
$dom = new DOMDocument();
$dom->validateOnParse = true;
$dom->loadHTML($file_url);
echo $dom->getElementById("txt")->nodeValue;
}
?>
/------------target simple.html page
just output "after " to div tag at id="txt" after the body onload from javascript
function init() done
I use curl php with $dom.getElementById("txt")->nodeValue to extract
"after" but it just echo out"before" (at div tag) which is the value before excuting
javascript init() on body onload, Why ?
On FireFox firebug, we can see the complete javascript code is done and output
the "after" data when view the page source.
COuld we use php curl to extract the DOM data after parsing all javascript coding
and function execution is completed on the html web page.
I try $dom->validateOnParse = true; but it is still not working.
If we can see the "after" data on my IE broswer, we should be able to extract it
from curl php like browser's view source option , Right ?
Please advise
Duncan
<?php
include "include'/curl.php";
$url="http://www.mysite.com/simple.html";
$file_url=my_curl($url,"" , 7, TRUE,2,"");
}
if ($file_url) {
$dom = new DOMDocument();
$dom->validateOnParse = true;
$dom->loadHTML($file_url);
echo $dom->getElementById("txt")->nodeValue;
}
?>
/------------target simple.html page