macbre / phantomas

Headless Chromium-based web performance metrics collector and monitoring tool

Home Page:https://www.npmjs.com/package/phantomas

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upgrade to PhantomJS 2.1.1

macbre opened this issue · comments

Waiting for fixes for Linux binaries - ariya/phantomjs#12970

any estimate on this?
those damn ssl bugs with phantom are doing my head in.
>:(

Waiting for phantomjs issue being resolved

what do these new binaries afford us?

Well, for starters 1.9.1 seems to currently fail to install on windows due to ws version failing currently. Which is due to socket.io having issues. 2.x doesn't have the issue

package.json:

+    "phantomjs": "Medium/phantomjs#version-2.0",
$ npm update phantomjs 
/
> phantomjs@2.0.0-alpha1 install /home/macbre/src/github/phantomas/node_modules/phantomjs
> node install.js

There is no prebuilt binary for your platform: linux x64 3.13.0-54-generic
You should install phantomjs from source, put the binary on your PATH, and try again

Forked phantomjs npm module to use the latest PhantomJS 2.0 binaries (unofficial ones) and Ubuntu 12.04 binaries for Travis CI.

So we're getting some progress?

I believe PhantomJS 2 has better support for SNI -- the lack of support in PhantomJS 1 makes phantomas fail on HTTPS sites which require SNI.

@Martinspire, no progress. Still waiting for 32-bit and Debian-compatible binaries.

I think we'll end up forking phantomjs npm module and compiling "our" own PhantomJS 2.0 binaries with statically-linked libraries.

Good news, everyone :)

I've managed to compile PhantomJS 2 binary using Docker (running Ubuntu 14.04 image) with statically-linked libraries (#540 / macbre/phantomjs2-npm#1). It runs smoothly on Debian 8.1 amd64.

That's fantastic! I added myself as a subscriber to #531, and will happily test phantomas out on a batch of .gov sites I watch, once it's out.

@konklone, @gmetais - #531 is now merged into devel branch. You can use PhantomJS 2.0.0 by settings an environment variable:

PHANTOMAS_ENGINE=webkit2 phantomas "http://example.com"

or passing --engine=webkit2 option.

webkit (i.e. PhantomJS 1.9.x) will still be a default because of huge problems with Linux binaries for PhantomJS 2.0.0.

Thanks for your great work!

It fails on OSX, here is the debug log:

DEBUG=* node bin/phantomas.js http://www.google.fr --engine=webkit2
  optimist:config parse: ["node","/Users/gaelmetais/Documents/GitHub/phantomas/bin/phantomas.js","http://www.google.fr","--engine=webkit2"] +0ms
  optimist:config options: {"_":["node","/Users/gaelmetais/Documents/GitHub/phantomas/bin/phantomas.js","http://www.google.fr"],"version":false,"V":false,"help":false,"h":false,"verbose":false,"v":false,"disable-js":false,"no-externals":false,"scroll":false,"spy-eval":false,"stop-at-onload":false,"analyze-css":false,"colors":false,"film-strip":false,"page-source":false,"progress":false,"silent":false,"engine":"webkit2","ssl-protocol":"any","timeout":15,"reporter":"plain","R":"plain","format":"plain","$0":"node ./bin/phantomas.js"} +1ms
  phantomas:cli Preparing 1 run(s)... +1ms
  phantomas nodejs v0.10.33 +1ms
  phantomas phantomas v1.11.0 installed in /Users/gaelmetais/Documents/GitHub/phantomas +0ms
  phantomas URL: <http://www.google.fr> +0ms
  phantomas Options: {"version":false,"V":false,"help":false,"h":false,"verbose":false,"v":false,"disable-js":false,"no-externals":false,"scroll":false,"spy-eval":false,"stop-at-onload":false,"analyze-css":false,"colors":false,"film-strip":false,"page-source":false,"progress":false,"silent":false,"engine":"webkit2","ssl-protocol":"any","timeout":15,"reporter":"plain","R":"plain","format":"plain"} +0ms
  phantomas Temporary directory: /var/folders/5h/_fm174694_x75lcs7y9tt9xc0000gn/T//phantomas/d5e9d76c-9769-454b-8896-64195879e96f/ +4ms
  phantomas:engines Engine "webkit": PhantomJS v1.9.8 installed in /Users/gaelmetais/Documents/GitHub/phantomas/node_modules/phantomjs/lib/phantom/bin/phantomjs +3ms
  phantomas:engines Engine "webkit2": PhantomJS v2.0.0 installed in /Users/gaelmetais/Documents/GitHub/phantomas/node_modules/phantomjs2/lib/phantom/bin/phantomjs +6ms
  phantomas:engines Engine "gecko": SlimerJS v0.9.5 installed in /Users/gaelmetais/Documents/GitHub/phantomas/node_modules/slimerjs/lib/slimer/slimerjs +5ms
  phantomas:engines Running /Users/gaelmetais/Documents/GitHub/phantomas/scripts/phantomas.js (using PhantomJS) +1ms
  phantomas:engines Passing phantomas options: {"version":false,"V":false,"help":false,"h":false,"verbose":false,"v":false,"disable-js":false,"no-externals":false,"scroll":false,"spy-eval":false,"stop-at-onload":false,"analyze-css":false,"colors":false,"film-strip":false,"page-source":false,"progress":false,"silent":false,"engine":"webkit2","timeout":15,"reporter":"plain","R":"plain","format":"plain","url":"http://www.google.fr","user-agent":"phantomas/1.11.0 (PhantomJS/2.0.0; darwin x64)"} +0ms
  phantomas:engines Passing engine options: ["--debug=false","--ssl-protocol=any"] +0ms
  phantomas Spawned with pid #52344 +4ms
phantomas: (255) Engine crashed unexpectedly
  phantomas:results Process returned code #255 +6ms
  phantomas:results Error when parsing JSON (SyntaxError: Unexpected end of input) +0ms
  phantomas:runs results [1]: [[{},null]] +1ms
  phantomas:runs Run #1 did not complete - err #255 +0ms
  phantomas:runs err: "255" +1ms
  phantomas:runs Exiting with code #255 +0ms

It's working correctly in an Ubuntu VM, I'm going to make some comparison tests between 1.9 and 2.0 :)

This is working great on Linux.

Fixes these bugs:

  • SSL problems on some websites (error 254)
  • JS errors on ECMAScript 5 such as with 'Function.prototype.bind'

Great!

As for the OSX problems - can you run phantomas with --debug argument and provide the output?

There's not more output with the --debug argument:

node bin/phantomas.js http://www.google.fr --engine=webkit2 --debug
  phantomas: (255) Engine crashed unexpectedly

@gmetais, it seems that PhantomJS segfaults on OSX. Can you reproduce this issue on different URLs?

On any URL. In fact, it fails so quickly (less than 250ms, I guess) that it probably doesn't have the time to start calling the URL.

Hey @macbre!

For your information, the public http://yellowlab.tools instance has been using PhantomJS 2 for one week, testing hundreds of websites, and no-one has complained yet! (It's using your devel branch.)

Just wanted to share this good news!

Glad to hear that :)

Since #531 PhantomJS 2.0 is one of supported engines.

Because of problems with statically linked binaries for Linux, I'm not going to make PhantomJS 2 a default engine, yet.

ariya/phantomjs#12970 - PhantomJS 2.1 released!

It did take a while, but we can now use official binaries for PhantomJS 2.x,

Was there a resolution for this I'm getting the following issue (phantomjs 2.1.1, and phantomas v1.20.1):

phantomas http://google.com

/usr/lib/node_modules/phantomas/lib/engines.js:57
			throw 'Engine "' + this.options.engine + '" not found!';
			^
Engine "webkit2" not found!
(Use `node --trace-uncaught ...` to show where the exception was thrown)