Search code examples
javascriptgoogle-chromefirefoxserver-side

How to open a webpage with Firefox/Chrome on server and save it to a HTML file?


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?


Solution

  • For a server-side programmatically-controllable browser, use PhantomJS.