Hi,
I am new to ZombieJS, and perhaps I have not fully understood how browser.visit() works. When I try to visit a URL that contains multiple redirects, I sometimes end up with browser.StatusCode = undefined. Since this is happening intermittently, I suspect it is some kind of a timing issue. Can someone help me understand what I am doing wrong. I am using Zombie 2.0.0-alpha29 Here is my code
var Browser = require("zombie");
var assert = require("assert");
var browserOptions = {
debug : true,
userAgent : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1664.3 Safari/537.36"
};
var browser = new Browser(browserOptions);
browser.visit(url, function(){
console.log("Status Code = " + browser.statusCode + ", success = " + browser.success);
});
Most of the time I get the normal/correct response, which is
Status Code = 200, success = true
Zombie: Event loop is empty
But sometimes I get the following
Status Code = undefined, success = false
Zombie: Event loop is empty
Regards
SD