I've started using Phantom JS on Windows, but I'm having a bit of difficulty finding documentation on its capability (probably the root of my problem).
Using Phantom JS I would like to do the following:
- Give it a local machine folder location,
- Have it navigate to that location and identify the list of HTML files,
- Once that list is identified to loop of the the list of HTML files and convert them all to PNG (similar to the way the rasterize.js example works), where the filename gsubs "HTML" with "PNG".
I'm sure this is probably possible, but I wasn't able to find the Phantom JS function call for:
- getting the list of files in a folder and
- the format for gsub and grep in Phantom JS.
Hope this helps. For more information about the FileSystem calls, check this page out: http://phantomjs.org/api/fs/
Also, I wanted to add, that I believe the FileSystem functions are only available in PhantomJS 1.3 or later. Please make sure to run the latest version. I used PyPhantomJS for Windows but I'm sure this will work without a hitch on other systems as well.