First, thanks for phantomjs, its looking great. Second, sorry for all the noob questions; but... i'm a noob.
Why is my page.open callback called twice?
If i have no phantom.exit i get:
2. 483 function g(c){var d="undefined",a="1";if(c&&c.getE
2. 483 function g(c){var d="undefined",a="1";if(c&&c.getE
3. 12672 (function(){try{var e=!0,h=!1;var aa=function(a,b,
4. 33 window.gbar&&gbar.eli&&gbar.eli()
5. 33 window.gbar&&gbar.elp&&gbar.elp()
but if i have a phantom.exit i get:
2. 483 function g(c){var d="undefined",a="1";if(c&&c.getE
Here's the code:
var page = new WebPage(),
page.open(address, function (status) {
if (status !== 'success') {
phantom.exit(); // comment this line
function show_scripts ( ) {
var scripts = page.evaluate(function () {
s=document.getElementsByTagName("script");
for (var i=0; i<s.length; i++) {
console.log('Found ' + scripts.length + ' scripts');
for (var i=0; i<scripts.length; i++) {
console.log((i+1) + '. ' + s.length + ' ' + s.substr(0, 50));