PhantomJS / Javascript: write to file instead of to console

javascript, phantomjs

Solution

So I figured it out:

>phantomjs.exe file_to_run.js > my_log.txt

Problem

From PhantomJS, how do I write to a log instead of to the console? In the examples https://github.com/ariya/phantomjs/wiki/Examples, it always (in the ones I have looked at) says something like: ``` console.log('some stuff I wrote'); ``` This is not so useful.

Original source