News for hackers. Stuff that matters.
Re:PhantomJS 2.5.0 beta by heipei on Sunday January 08, 2017 @03:15PM (#13351719)
This is just my opinion, but I can see PhantomJS lose a lot of its appeal when the --headless switch for Google Chrome hits the stable channel (quite a way off still, sure). This was already discussed to some extent here: https://news.ycombinator.com/item?id=11839303. Add a couple of porcelain libraries on top of chrome-remote-interface, and you have an even more powerful instrumented headless browser, plus you don't need to worry about security, performance and keeping up with crazy new web features. Also, Chrome headless will encompass features aimed at automation/CI like:

- "Virtual" time (fast-forward time) - Session isolation (even for same origin) - Full page screenshots out of the box

Slides for Chrome headless: https://docs.google.com/presentation/d/1gqK9F4lGAY3TZudAtdcx...

Shameless plug: I'm using Google Chrome to drive https://urlscan.io and will make the switch to the headless version once it's included in the Beta channel.

Re:PhantomJS 2.5.0 beta by stevebmark on Sunday January 08, 2017 @04:03PM (#13352004)
I always disliked working with Phantom. Slow, buggy, crashy, limiting and weird subset of Javascript support with an awful ecosystem of hacks trying to get it usable in Node. I can't wait until a more stable tool superceeds it.
Re:PhantomJS 2.5.0 beta by zlagen on Sunday January 08, 2017 @06:12PM (#13352681)
Casperjs, which runs on top of PhantomJS has been nicer to use for me. Also Nightmare(http://www.nightmarejs.org/). The problem I always had with PhantomJS is that it's more difficult than it should be to automatize very simple website interactions. In Nightmare's homepage you can see a comparison between a script made in PhantomJS and one in Nightmare.
Re:PhantomJS 2.5.0 beta by fake-name on Sunday January 08, 2017 @07:59PM (#13353204)
NightmareJS isn't headless, which is a dealbreaker for me.

I'm automating in environments that don't have X.

Re:PhantomJS 2.5.0 beta by jazoom on Monday January 09, 2017 @01:48AM (#13354526)
Yeah, that's the problem with Nightmare. It's great otherwise.
Re:PhantomJS 2.5.0 beta by beobab on Monday January 09, 2017 @05:52AM (#13355418)
Witty comment about it being a Nightmare.
Re:PhantomJS 2.5.0 beta by btrask on Sunday January 08, 2017 @07:54PM (#13353190)
These abstractions are building on top of sand.
Re:PhantomJS 2.5.0 beta by jazoom on Monday January 09, 2017 @01:48AM (#13354527)
Electron isn't sand.
Re:PhantomJS 2.5.0 beta by gowan on Sunday January 08, 2017 @06:53PM (#13352909)
i built chromium headless_shell for ubuntu 16 in the last 3 months to compare it to my phantomjs 2.1.1 build (cookie patch and ghostdriver selenium 2.53 patch). i was disappointed in what chromium headless_shell had to offer.

good: slightly faster on javascript heavy pages, full dowload and upload support, selenium support for alerts/popups

bad: slower startup, slower average performance, no mobile support, no screenshot support, takes at least 2x cpu and memory compared to phantomjs

for me phantomjs/ghostdriver is faster than chromedriver. plus chromedriver has an annoying click "feature"[1] that can break selenium tests.

[1] https://sites.google.com/a/chromium.org/chromedriver/help/cl...

Re:PhantomJS 2.5.0 beta by hackcasual on Monday January 09, 2017 @12:41AM (#13354269)
Screenshot support is done through the chrome remote debug API. https://chromedevtools.github.io/debugger-protocol-viewer/to...
Re:PhantomJS 2.5.0 beta by fake-name on Sunday January 08, 2017 @07:56PM (#13353198)
Headless chromium is reasonably stable now.

I'm working on a wrapper to completely expose the chrome remote debug interface in python [here](https://github.com/fake-name/ChromeController), if you're interested. In doing so, I've found (and reported) several bugs in the remote interface documentation as well. It's a fun project.

I hope to eventually completely replace phantomjs in my automated scraping project with headless chromium, but there's still some [strange issues](https://bugs.chromium.org/p/chromium/issues/detail?id=672744).

Re:PhantomJS 2.5.0 beta by jotto on Sunday January 08, 2017 @03:50PM (#13351934)
shameless plug: I'm already using headless Chrome for https://www.prerender.cloud/ and it's amazing (just building it from source https://docs.google.com/document/d/1a9cdsljKxCSreR2LDE3KErJh...)
Re:PhantomJS 2.5.0 beta by kinlan on Sunday January 08, 2017 @03:58PM (#13351975)
Shameless plug: I've been using it to get Chrome on Google home - https://paul.kinlan.me/chrome-on-home/

(Disclosure: I'm a developer advocate for chrome so I'm heavily biased, but I love everything people are doing g with browsers on the server https://paul.kinlan.me/the-headless-web/ )

Re:PhantomJS 2.5.0 beta by nathancahill on Sunday January 08, 2017 @04:54PM (#13352270)
Super cool. I understand that you're biased, but this would have been easy to do with Readability.js from Mozilla :)

I wrote something similar to serve low-bandwidth (pre-readabilitied pages) to my parents low-bandwidth internet over a MITM proxy.

Re:PhantomJS 2.5.0 beta by kinlan on Monday January 09, 2017 @05:03AM (#13355247)
I had different plans before I started :) given my time again playing on the project I would use Readability.js :) was also looking at DOMDistiller.
Re:PhantomJS 2.5.0 beta by Sivart13 on Sunday January 08, 2017 @11:34PM (#13354036)
I agree, but let's not let perfect be the enemy of the good.

PhantomJS works well enough, 2.5 will hopefully work better. `--headless` will be even better than that, but it isn't here yet.