

Show HN: Phantom JS interactive editor - jakozaur
http://phantomjs-pad.ozaur.com/

======
kmike84
A shameless plug:
[https://github.com/scrapinghub/splash](https://github.com/scrapinghub/splash)
is an open source tool similar to Phantom JS, and it has an interactive web
editor built-in.

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...](http://splash.readthedocs.org/en/latest/scripting-
tutorial.html) 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](http://splash.readthedocs.org/en/latest/install.html).

~~~
tonyrice
There's also Automately ([http://automate.ly/](http://automate.ly/)) it's a
pretty interesting platform and it also allows for use of browser automation
but differently than PhantomJS it's a little confusing to get setup at first
but once you're there it's easy from there on.

~~~
kmike84
It doesn't look like Automately is open source, but their API looks nice
(based on examples from [http://blog.automate.ly/](http://blog.automate.ly/)).

~~~
automately
We will actually be open sourcing our core very soon! We will also be
including the source code for our SDK and Automately Pi (unreleased Raspberry
Pi integration).

------
tomvangoethem
Cool, comes in quite handy!

You may want to up your security-game though. Check the ~/FIXME file on your
sever for more info :-)

~~~
jakozaur
Yeah, know it, but didn't spent that much time on it and it suddenly attract
so much traction.

Will definitely do something serious about it.

~~~
jakozaur
Fixed. More security related improvements are coming.

------
davidy123
Since the formal semantic failed to become massively used, everyone is trying
to make sense of the Web using scraping. It's something most viable sites
should want to get behind, from ecommerce where you can find the best price
faster to education. But I suspect if a very good shared scraping system were
created we'd see countermeasures pretty fast, from timid content producers, as
well as the Googles who want to have exclusive access to this level of
information. Yet it's a natural layer for a shared commons, and what can be
built on that, when finally get past the mess of arbitrary representations, is
very exciting. Anyone know of any standard to create interoperable scrapers?
In Javascript, of course. Here's one submission:
[https://github.com/zotero/translators](https://github.com/zotero/translators)

~~~
biomimic
You are spot on with this. Data acquisition is the foundation of data science
which in turn is the foundation of [fill in the blank]

------
mmccaff
Neat. Did you have a real use-case for this, or just fun? I'm curious, what
dependencies does it have that would make setup difficult?

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?

~~~
jakozaur
Right now it's for fun, but the real-use case is to make more productive. E.g.
be able to write test way faster.

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.

------
deanclatworthy
I tried with typekit with no success: [http://phantomjs-
pad.ozaur.com/DrDvxMADoP2TdF652](http://phantomjs-
pad.ozaur.com/DrDvxMADoP2TdF652)

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?

~~~
d4n3
The thing with phantomjs and webfonts is that it has an old webkit version
which has some bugs with webfont support.

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...](https://github.com/Vitallium/phantomjs/tree/fix-WOFF-file-support)

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)

~~~
warfangle
PhantomJS is falling further and further behind. It also doesn't, for example,
support scripts triggered DOM events.

The more time goes by, the more I'm considering removing it from our testing
suite.

------
angryrancor
This is really cool. Just getting deep in to phantomjs myself, I'm sure this
will help a bit :)

------
jakozaur
Author here: oh no Google banned traffic from my AWS instance and google.com
shows blank :-(.

~~~
timdorr
Yeah, they'll do that :)

Can we download this and run it locally? Is the code open sourced somewhere?

~~~
jakozaur
Not yet open-sourced or downloaded, but consider doing that.

Right now the setup would be too hard to make it smooth.

~~~
zenlikethat
Put it in a Docker container! :)

------
AustinScript
I am a big fan of CasperJS which sits atop PhantomJS. This tool certain looks
like a fun way to get introduced to Phantom.

------
pkrein
would love to write the script using
[http://www.nightmarejs.org](http://www.nightmarejs.org) instead ;)

------
daemonk
phantomjs is great for rastering svgs (d3.js visualizations)

~~~
landr0id
That's exactly what I've used it for. My only complaint is that the
documentation is not as nice as it could be.

