Created
March 23, 2018 14:49
-
-
Save lai32290/59d76f73fe6d3be9894291176534367d to your computer and use it in GitHub Desktop.
Ching Ling
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
const Nightmare = require('nightmare') | |
const nightmare = Nightmare({ show: true }) | |
nightmare | |
.goto('http://blablablablabla/logon/logon.asp') | |
.wait(() => { | |
return document.querySelector('[name=username]') !== null; | |
}) | |
.evaluate(() => { | |
document.querySelector('[name=username]').value = "visitante"; | |
document.querySelector('[name=senha]').value = "visitante"; | |
}) | |
.wait(5000) | |
.end() | |
.then(console.log) | |
.catch(error => { | |
console.error('Search failed:', error) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment