Is it possible to get the content of a URL with PHP (using some sort of function like file_get_contents or header) but only after the execution of
Update 2 Adds more details on how to use phantomjs from PHP.
Update 1 (after clarification that javascript on target page need to run first)
1. Download phantomjs and place the executable in a path that your PHP binary can reach.
2. Place the following 2 files in the same directory:
get-website.php
get-website.js
var webPage = require('webpage');
var page = webPage.create();
page.open('http://google.com/', function(status) {
console.log(page.content);
phantom.exit();
});
3. Browse to get-website.php and the target site, http://google.com contents will return after executing inline javascript. You can also call this from a command line using php /path/to/get-website.php.
/get-website.php
test.html
on demo