-
Notifications
You must be signed in to change notification settings - Fork 204
Closed
Description
I'm trying to understand how V8JS works, I did a test but it did not work.
I would like to render this site https://react.rocks/ to then use the DOMDocument.
So I did this:
$url = 'https://react.rocks/';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$file = curl_exec($ch);
$dom = new DOMDocument;
$dom->loadHTML($file);
$v8 = new V8Js();
foreach( $dom->getElementsByTagName('script') as $script){
$v8->executeString($script->nodeValue);
}
$exec = file_get_contents('https://react.rocks/scripts/bundle.js');
$v8->executeString($exec);
echo $file;
I've had this return
Uncaught exception 'V8JsScriptException' with message 'V8Js::compileString():2: ReferenceError: window is not defined' in info.php:18 Stack trace: #0 info.php(18): V8Js->executeString('var z={accessTo...') #1 {main} thrown in
Metadata
Metadata
Assignees
Labels
No labels