Show HN: Phantom JS interactive editor
phantomjs-pad.ozaur.com
phantomjs-pad.ozaur.com
The concurrency model in Splash scripts is not the same as in Phantom JS scripts: Splash allows to use loops/ifs/functions in async code without recursion tricks or things like "casper.thenOpen". See http://splash.readthedocs.org/en/latest/scripting-tutorial.h... for more info.
We haven't done a public announcement, and Splash is not yet feature complete, but it is used in production for more than a year, there are hundreds of unit tests and it is in active (though a bit sporadic) development - so give it a try if you want something different :)
Installation is just "docker pull scrapinghub/splash" - see http://splash.readthedocs.org/en/latest/install.html.
It's not open source, but there's a free tier and lots of nice features built in like video recording, screenshot comparison and a GUI editor.
If anyone is planning to write PhantomJS scripts directly, I strongly recommend checking out CasperJS: http://casperjs.org/ -- It gives you a really nice layer on top that makes Phantom much more wieldy.
Edit: Here's a very simple example http://searchproxy.automate.ly/
It would be interesting to see what type of customers or use cases your solution might be of use.
Will have a look. PhantomJS development seems stagnate a bit. Try to contribute to it myself.
Splash Web UI is quite similar to PhantomJS Pad UI - by default it shows a CodeMirror text editor (with a simple autocompletion) and a screenshot of the webpage. Also, by default it shows information about requests/responses (like a "Network" tab in Firefox/Chrome development console) and a textarea with rendered html.
PhantomJS Pad UI ideas are good; tabs for images, an editor window which is open by default and a field with console logs make a lot of sense.
You may want to up your security-game though. Check the ~/FIXME file on your sever for more info :-)
Will definitely do something serious about it.
In the Yelp example, I was confused for a second by the variable name of 'pizza' when doing a Yelp search on seafood. Renaming that would make the example more clear. :)
What does the browser-view show? I didn't try, but if the code traverses multiple locations, is it a screenshot of the last step?
Browser-view shows at the end and whenever you write page.render().
Making setup smooth is solve able problem, I just haven't spent time on that. It uses Meteor and PhantomJS.
I was curious with this example, as I have had zero luck getting webfonts to render using PhantomJS so far. Have you had any success rendering webfonts?
Theres a branch from a phantomjs contributor on github that has bugfixes for webfonts support backported:
https://github.com/Vitallium/phantomjs/tree/fix-WOFF-file-su...
I use phantomjs for html to image rendering and I managed to get webfont support working with a custom build from that branch (working on Heroku)
The more time goes by, the more I'm considering removing it from our testing suite.
Can we download this and run it locally? Is the code open sourced somewhere?
Right now the setup would be too hard to make it smooth.
Just an FYI… the editor is collapsing in Safari.