Quantcast
Viewing all articles
Browse latest Browse all 3204

No results from PHP exec of headless chrome (no replies)

Attempting to exec headless chrome from PHP to get the html source of a webpage after javascript runs, the command works from the windows command line, but returns nothing when executed in PHP. Note the url shown below is only for testing.

The command and script (used \ instead of / in exec below or it would not show on forum)

<?php
$output=null;
$retval=null;
exec('start chrome --headless --dump-dom https:\\developer.chrome.com\',$output, $retval);
var_dump($output);
var_dump($retval);
?>

Results
C:\wamp64\www\cz\Test\execchrome.php:5:
array (size=0)
empty
C:\wamp64\www\cz\Test\execchrome.php:6:int 0

I've also tried commands shell_exec and popen with similar results. There are no errors in the appache log. Any help appreciated.

Viewing all articles
Browse latest Browse all 3204

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>