I want to open a webpage with Firefox or Chrome on server (Apache) using command line, and save it to a file:
firefox http://example.com > mypage.html //it doesn't work
this command should execute browser javascript code and returns what it prints like on normal browsing.
Is it possible with Chrome/Firefox?
For a server-side programmatically-controllable browser, use PhantomJS.