Thanks guys!
But actually everything is working flawlessly as soon as I plugged in the jQuery document.ready:
----
var page = require('webpage').create();
page.onLoadStarted = function()
{
console.log('Now loading ' + page.url + '...');
};
page.open('
http://cat.com/', function(status)
{
console.log(page.url + ' loaded, status = ' + status);
if (status === 'success')
{
page.includeJs('
http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', function()
{
console.log('jQuery in');
var response = page.evaluate(function()
{
$(document).ready(function()
{
console.log('Document ready...');
return;
});
});
page.render('cat.png');
phantom.exit();
});
}
});
-----
cat.com uses a JS-based redirect, and the combination of phantomJS + jQuery document.ready digests that perfectly!
I am amazed at this product! Hats off Ariya!!!
-----
Now, if I may use this thread to go back to the original post, that was about this 100% JS-based site:
http://www.thelightroomdesigns.com/With jQuery document.ready, I get phantomJS to start processing the site, but it bails out with this error:
TypeError: 'undefined' is not a function (evaluating '$(document).getSize()')
http://static.wix.com/services/html-wysiwyg/1.227.4/web-viewer-components.js:1922 ...
I assume there is something wrong in the JS, but nevertheless the site loads fine in Safari / Chrome. And the JS console does not report that error, not even as a warning.
Is there anyway I can avoid phantomJS to quit in case of incorrect JS?
ty in advance.
m