Is there a way to use a command line tool to view the JavaScript interpreted source of a web page? Is there a way to use a command line tool to view the JavaScript interpreted source of a web page? curl curl

Is there a way to use a command line tool to view the JavaScript interpreted source of a web page?


Have you looked in to tools like PhantomJS for running the tests? Many of them support running a "headless" browser, which lets you render pages and run JS against the rendered page without having to actually run a browser. It doesn't use curl, but I don't see why that should be a requirement.

For instance:

$ phantomjs save_page.js http://example.com 

with save_page.js:

var system = require('system');var page = require('webpage').create();page.open(system.args[1], function(){    console.log(page.content);    phantom.exit();});