var page = new WebPage()
var address = phantom.args[0]

page.onConsoleMessage = function(msg) {
  console.log(msg)

  if (msg === '[END]') {
    var result = page.evaluate(function() {
      return result
    })

    if (result.error.count + result.fail.count) {
      phantom.exit(1)
    } else {
      phantom.exit(0)
    }
  }
}

page.open(address, function(status) {
  if (status !== 'success') {
    console.log('FAIL to load this address: ' + address)
  }
})

@@ -8,51 +8,35 @@
 e = 
-new WebPage()%0Avar address = phantom.args%5B0%5D
+require('webpage').create()
 %0A%0Apa
@@ -310,16 +310,78 @@
 %0A  %7D%0A%7D%0A%0A
+%0Avar system = require('system')%0Avar address = system.args%5B0%5D%0A%0A
 page.ope

Improve phantom.js