0
docsで表示されている例は、.then()の前に.end()を使用しています。このよう連鎖した後のNightmareJsインスタンスの終了方法
nightmare
.goto('http://yahoo.com')
.type('form[action*="/search"] [name=p]', 'github nightmare')
.click('form[action*="/search"] [type=submit]')
.wait('#main')
.evaluate(function() {
return document.querySelector('#main .searchCenterMiddle li a').href
})
.end()
.then(function (result) {
console.log(result)
})
.catch(function (error) {
console.error('Search failed:', error);
});
として はしかし、私は...のようにそれを行うには
...
.then(function() {...})
.end()
をしようとしているしかし、私は.ENDが存在しないというエラーを取得します。
私も以下を試しましたが、エラーは発生しませんが、悪夢がハングアップする原因になります。 Github issue discussion
nightmare.endパー
...
.then(function() {...})
.then(function() {
nightmare.end()
});