问题
Can anyone give me the differences between those versions?
What can I do in version 2 that I could not do in earlier versions?
I use PhantomJS to execute code generated by Selenium. Will be there performance improvements?
回答1:
PhantomJS 2 has a "new" WebKit version underneath. So it changed from 534.34 in PhantomJS 1 to 538.1 in PhantomJS 2. The difference in numbers in this dimension is not big, but there is a more than two year difference between the release of the two WebKit versions. See also: Does PhantomJS use QtWebKit or Blink?
It's not that its performance is better, but rather that it supports more up-to-date web standards and APIs, and has less bugs.
Problems in the past:
element.click()
was not available on all elements, but only on<input>
and<button>
elements. (Workaround)- PhantomJS has now
Function.prototype.bind
which doesn't need a shim anymore. - PhantomJS <1.9.8 used SSLv3 by default which broke many scripts one day.
- PhantomJS 1 has a bug with :nth-child() selectors.
来源:https://stackoverflow.com/questions/28557100/difference-between-phantomjs-2-0-and-phantomjs-1-9