Created
January 22, 2017 22:50
-
-
Save MikeCook9994/c80d56bc142c42fcb04d2c4e7a49855f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import Nightmare from 'nightmare' | |
let nightmare = new Nightmare(); | |
Nightmare.action('enableRequestListener', | |
(name, options, parent, win, renderer, done) => { | |
parent.respondTo('enableRequestListener', (done) => { | |
win.webContents.session.defaultSession.webRequest.onCompleted({}, (details) => { | |
}); | |
}); | |
done(); | |
}, | |
(done) => { this.child.call('enableRequestListener', done); } | |
); | |
nightmare | |
.goto(FACEBOOK_AUTHENTICATION_TOKEN_URL) | |
.type("#email", email) | |
.type("#pass", password) | |
.click("#loginbutton") | |
.wait("button[name='__CONFIRM__']") | |
.enableRequestListener() | |
.click("button[name='__CONFIRM__']") | |
.end() | |
.catch((e) => { console.log(e) }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment