var Nightmare = require('nightmare');
var nightmare = Nightmare({
show: true
})
nightmare
.goto('https://mail.yandex.ru')
.type('input[name=login]', 'mylogin')
.type('input[name=passwd]', 'mypassword')
.click('button.nb-button._nb-action-button.nb-group-start')
.wait('.mail-User-Name')
.cookies.get()
.then(function (cookies) {
//actions
})
我在授权后获得cookie,但我不知道我必须在哪里设置它们以及我必须如何设置它们.我一开始就尝试过.cookie.set(),但这不起作用.
我如何使用保存的cookie?谢谢.