Skip to content

Instantly share code, notes, and snippets.

@npow
Created July 3, 2012 23:36
Show Gist options
  • Save npow/3044156 to your computer and use it in GitHub Desktop.
Save npow/3044156 to your computer and use it in GitHub Desktop.
PhantomJS drag and drop
var page = require('webpage').create();
page.open('http://jsbin.com/ifuma#noedit', function () {
setTimeout(function () {
page.sendEvent("mousedown", 10, 10);
page.sendEvent("mousemove", 200, 200);
page.sendEvent("mouseup", 200, 200);
page.render('ss.png');
phantom.exit();
}, 3000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment