const j = require('request').jar();
const request = require('request').defaults({
jar: j
});
request({
method: 'GET',
url: "https://www.google.com/gen_204?atyp=csi&ei=_-34WouCCoaWsgWUsLfoBQ&s=newtab&adh=&conn=onchange&ima=1&ime=0&imeb=0&imeo=0&mem=ujhs.10,tjhs.10,jhsl.2190&rt=aft.13,ol.20,prt.14,xjs.317,xjsee.317,xjses.230,xjsls.37,wsrt.95,cst.0,dnst.0,rqst.18,rspt.10,rqstt.27,unt.25,cstt.25,dit.111&zx=1526264059738"
}, function(err, res, body) {
console.log(JSON.stringify(j._jar.cookies));
это дает:
не определено
console.log(JSON.stringify(j));
это дает:
{ "_ банка": { "версия": "tough-cookie@2.3.3", "storeType": "MemoryCookieStore", "rejectPublicSuffixes": правда, "печенье": [{ "ключ": "У" , "значение": "130 = F2nMvgnjWwGNndAE7c0rlU8AIgvX-EsDL-qc_kFLT18upWh87niN-_Th5oMbUyDe7LV5HWNVcsUKb6SUwQuC6VTWgC-jnPmHo4tLnFPb8r7p3CEbMN7MYxAFpucRfl8o", "истекает": "2018-11-13T03: 50: 35.000Z", "домен": "google.com", "путь": "/","httpOnly":true,"hostOnly":false,"creation":"2018-05-14T03:50:35.944Z","lastAccessed":"2018-05-14T03:50:35.944Z"} ]}}
});
Мне нужны куки: [], как показано в выводе выше.