Answer the question
In order to leave comments, you need to log in
Why doesn't Nightmare.js work?
I'm trying to load a page, login, go to the next page, upload it, and show it's HTML.
const Nightmare = require('nightmare');
const nightmare = Nightmare({show: true});
nightmare
.goto('url')
.type('#login', login)
.type('#password', password)
.click('#sub-btn')
.goto('url1')
.evaluate(() => {
try {
return document.documentElement.outerHTML;
} catch (e) {
return e.toString();
}
})
.end()
.then((result) => res.send(result()))
.catch(() => console.log('error'));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question