Skip to content

Instantly share code, notes, and snippets.

@AndrewO
Created January 14, 2011 16:32
Show Gist options
  • Save AndrewO/779834 to your computer and use it in GitHub Desktop.
Save AndrewO/779834 to your computer and use it in GitHub Desktop.
A barebones test to confirm zombie.js is installed correctly.
<html>
<body>
<a href="click_me.html" id="click_me">Click me</a>
</body>
</html>
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