4 ms·
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
by heipei 10y ago
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 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/1gqK9F4lGAY3TZudAtdcxzMQNEE7PcuQrGu83No3l0lw/edit#slide=id.g13338d98ec_0_25 https://docs.google.com/presentation/d/1gqK9F4lGAY3TZudAtdcx...
Shameless plug: I'm using Google Chrome to drive https://urlscan.io https://urlscan.io and will make the switch to the headless version once it's included in the Beta channel.
- jotto 10y agoshameless plug: I'm already using headless Chrome for https://www.prerender.cloud/ https://www.prerender.cloud/ and it's amazing (just building it from source https://docs.google.com/document/d/1a9cdsljKxCSreR2LDE3KErJhfyC0N9y5ju2UYZb8-J4/edit https://docs.google.com/document/d/1a9cdsljKxCSreR2LDE3KErJh...)
- kinlan 10y agoShameless plug: I've been using it to get Chrome on Google home - https://paul.kinlan.me/chrome-on-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/ https://paul.kinlan.me/the-headless-web/ )
- nathancahill 10y agoSuper 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.
- kinlan 10y agoI had different plans before I started :) given my time again playing on the project I would use Readability.js :) was also looking at DOMDistiller.
- stevebmark 10y agoI 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.
- zlagen 10y agoCasperjs, which runs on top of PhantomJS has been nicer to use for me. Also Nightmare(http://www.nightmarejs.org/ 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.
- gowan 10y agoi 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/clicking-issues https://sites.google.com/a/chromium.org/chromedriver/help/cl...
- hackcasual 10y agoScreenshot support is done through the chrome remote debug API. https://chromedevtools.github.io/debugger-protocol-viewer/tot/Page/#method-captureScreenshot https://chromedevtools.github.io/debugger-protocol-viewer/to...
- fake-name 10y agoHeadless 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 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 https://bugs.chromium.org/p/chromium/issues/detail?id=672744).
- Sivart13 10y agoI 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.