Note that there are some explanatory texts on larger screens.

plurals
  1. POPerformance of phantom.js vs zombie.js
    primarykey
    data
    text
    <p>I'm evaluating <a href="http://phantomjs.org/" rel="nofollow noreferrer">phantom.js</a> and <a href="http://zombie.labnotes.org/" rel="nofollow noreferrer">zombie.js</a>. I expected the trade-off to be that phantom has wider documents support (since it uses a real renderer) while zombie is faster (since no rendering engine is used). However zombie seems much slower in the test I did. Does this make sense? </p> <p>I am thinking maybe zombie waits for the full page to load before visit() returns (including running all scripts and loadsing css) while phantom returns immediatelly after start() (I used casperjs) allowing me to continue without waiting for the full page.</p> <p><strong>Phantom.js</strong></p> <pre><code>casper.userAgent("Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13"); casper.test.begin('bing search', 2, function(test) { casper.start('http://www.bing.com/', function() { this.waitUntilVisible('#sb_form_q', function() { this.sendKeys('#sb_form_q', "book", true); this.click('#sb_form_go'); this.waitUntilVisible('#count', function() { var val = this.evaluate(function() { return document.getElementById('count').innerText }); console.log(val) }); }); }).run(function() { test.done(); }); }); </code></pre> <p><strong>Zombie.js</strong></p> <pre><code>var Browser = require("zombie"); var browser = new Browser() browser.userAgent = "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13" browser.visit("http://www.bing.com/", function() { browser.fill("#sb_form_q", "book"); browser.pressButton("#sb_form_go"); function resultArrived(window) { return window.document.querySelector("#count") } browser.wait(resultArrived, function() { console.log(browser.document.querySelector("#count").innerHTML) }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload