Created
January 14, 2011 16:32
-
-
Save AndrewO/779834 to your computer and use it in GitHub Desktop.
A barebones test to confirm zombie.js is installed correctly.
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
<html> | |
<body> | |
<a href="click_me.html" id="click_me">Click me</a> | |
</body> | |
</html> |
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 zombie = require("zombie"); | |
zombie.visit("http://localhost/click_me.html", {debug: true}, function(err, browser) { | |
if (err) { | |
console.log(err.message); | |
} else { | |
console.log(browser.html()); | |
browser.clickLink("#click_me", function(err, browser) { | |
if (err) { | |
console.log(err.message); | |
} else { | |
console.log(browser.lastResponse); | |
browser.dump(); | |
} | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment