views:

189

answers:

3

Is there a command line utility (preferrably for Linux) that can output the resulting HTML after any JavaScript execution?

Since many web sites use Javascript to modify the output substantially, it is sometimes not sufficient to use an HTML parser to read data from a web page. A command line utility or library that enables you to see the resulting HTML, after any initial JavaScript has been executed, could help with this.

+2  A: 

this might help you Bringing browser to the server,Crosscheck

Eldar Djafarov
+1  A: 

If you are interested in catching the output of webpages running JavaScript, see HtmlUnit, a "GUI-Less browser for Java programs". Otherwise get a JS interpreter – Rhino, Spidermonkey, etc. – and a corresponding DOM environment as Djko suggested.

Török Gábor
A: 

I recommend using the Firebug plugin in Firefox. They have all the tools necessary at the bottom of the screen when you enable the fire bug utility!

I've used this tool to see what HTML is generated by php. The beautiful part is it will let you edit the client html so play around with the look and feel without changing an of your code. All you have to do is edit it in the tool and your browser will allow you to preview the change.

You can get the free download at: http://getfirebug.com/

gsirianni