Last active
May 19, 2020 06:26
-
-
Save junhan-z/fc4c3e5ca71e5361efbcee9282efaeae to your computer and use it in GitHub Desktop.
Use PhantomJS to Log in to IEEE
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 page = require('webpage').create(); | |
page.onConsoleMessage = function(msg) { | |
console.log(msg); | |
}; | |
var ieeeSignInUrl = "https://regauth.standards.ieee.org/standards-ra-web/rest/signin"; | |
page.open(ieeeSignInUrl, function(status) { | |
if ( status === "success" ) { | |
page.evaluate(function() { | |
document.querySelector("input[name='pf.username']").value = "[your email]"; | |
document.querySelector("input[name='pf.pass']").value = "[your password]"; | |
document.querySelector("input[name='submit']").click(); | |
console.log("Login submitted!"); | |
}); | |
window.setTimeout(function () { | |
page.render('colorwheel.png'); | |
phantom.exit(); | |
}, 15000); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment