0
ログインページの背後にある重いJSONをダウンロードしようとしています。 文書は約5MBで、接続に約60秒かかることがあります。このコードを試しましたが、結果として空のオブジェクトが残っています。 何が問題なのですか? ありがとう!悪夢のあるログインページの後ろにJSONをダウンロード
var Nightmare = require('nightmare');
var nightmare = Nightmare({
typeInterval: 300,
show: true
});
nightmare
.goto('https://pageThatRequireToLoginThenDiplayJsonAsText.com')
.type('[name=email]', '')
.wait(1000)
.type('[name=email]', 'myemail')
.wait(1000)
.type('[name=password]', '')
.wait(1000)
.type('[name=password]', 'mypassword')
.click('[type=submit]')
.wait(25000)
.wait(25000)
.evaluate(function (page, done) {
document.documentElement
done()
})
.end()
.then(function (result) {
// fs.writeFileSync('testOutput.json', JSON.stringify(result));
console.log(JSON.stringify(result))
})
.catch(function (error) {
console.error('failed:', error);
});
ナイトメアバージョン:2.8.1
ドキュメントを返すことはないので、 'result'がnullであるという謎はありません。 –
ご返信ありがとうございます。 私は悪夢を使用します。 結果が返っても同じ結果が得られます。 :/ –
ナイトメアのバージョン2.8.1を使用しています。あなたはそれについてどう思いますか? –