Skip to content

Instantly share code, notes, and snippets.

@vitallium
Created June 26, 2013 11:48
Show Gist options
  • Save vitallium/5866810 to your computer and use it in GitHub Desktop.
Save vitallium/5866810 to your computer and use it in GitHub Desktop.
Returning variables from page context
var page = require('webpage').create();
page.open('test.html', function() {
var v = page.evaluate(function() {
return HINCLUDED;
});
console.log(v);
phantom.exit();
});
<!DOCTYPE html>
<html>
<head>
<script>
var HINCLUDED = false;
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment