Created
May 17, 2012 11:24
-
-
Save vincicat/2718264 to your computer and use it in GitHub Desktop.
Zombie 1.1.2 browser.visit bug demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Browser = require("zombie"), jQuery = require("jquery") | |
var browser = new Browser({ | |
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19', | |
htmlParser: require('htmlparser'), //will or without giving same error | |
runScripts: false, | |
silent: true | |
}); | |
var urls = ["http://google.com", "http://yahoo.com"] | |
//url is a set of url | |
urls.forEach(function(v,id){ | |
var _path = v; | |
browser.visit(_path, function(e, browser, status){ | |
console.log("Zombie Bite: ",_path) | |
var window, $; | |
try { | |
window = browser.document.createWindow() | |
, $ = jQuery.create(window); | |
}catch(e){ | |
console.log("Failure & dying", id, e) | |
browser.dump() | |
//console.log(browser.html()) | |
return; | |
} | |
console.log("Stay Alive.") | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Zombie Bite: http://google.com | |
Stay Alive. | |
Zombie Bite: http://yahoo.com | |
Failure & dying 1 [TypeError: Object [ null ] has no method 'createWindow'] | |
Zombie: 1.1.2 | |
URL: http://hk.yahoo.com/?p=us | |
History: | |
1. http://google.com/ | |
2: http://hk.yahoo.com/?p=us | |
PREF=ID=cedf4bd7a96e2b7a:FF=0:TM=1337253261:LM=1337253261:S=tzQ88CJZzSNuLQ-n; Expires=Sat, 17 May 2014 11:14:21 GMT; Domain=google.com.hk; Path=/ | |
NID=59=jKBEh9ptsrfaWIMRMb4fwsPMJmLIjO7GSIVw3Nh8vy4_Ud47RxzHeKg0i3qvVi_cjn7gOmYEe47TVs1C1KEOee9BjxTASG8dcmZB05eU_P7ZdW0crCb2KMZIKq4duCi4; Expires=Fri, 16 Nov 2012 11:14:21 GMT; Domain=google.com.hk; Path=/; HttpOnly | |
B=9fe95d57r9ncf&b=3&s=v7; Expires=Sun, 18 May 2014 20:00:00 GMT; Domain=yahoo.com; Path=/ | |
D=_ylh=X3oDMTFyazc5cGw3BF9TAzI3MTYxNDkEcGlkAzEzMzcyNTI0MDAEdGVzdAMwBHRtcGwDaGstc3Bpcml0LXY1LTEwMjQucGhw; Domain=yahoo.com; Path=/ | |
FPC=t1; Expires=Sun, 18 May 2014 23:14:23 GMT; Domain=hk.yahoo.com; Path=/ | |
Cookies: | |
true | |
true | |
true | |
true | |
true | |
Storage: | |
Eventloop: | |
The time: Thu May 17 2012 19:14:25 GMT+0800 (HKT) | |
Timers: 0 | |
Processing: 0 | |
Waiting: 0 | |
Document: | |
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<link rel="apple-touch-icon" href="http://l.yimg.com/mq/i/home/apple_touch_icon.png" /> | |
<script language="javascript" type="text/javascript"> | |
var YAHOO=window.YAHOO||{};YAHOO.namespace=function(_1){if(!_1||!_1.length){return null;}var _2=_1.split(".");var _3=YAHOO;for(var i=(_2[0]=="YAHOO")?1:0;i<_2.length;++i){_3[_2[i]]=_3[_2[i]]||{};_3=_3[_2[i]];}return _3;};YAHOO.namespace("util"); | |
YAHOO.namespa... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment