请求模块,https套接字挂断

时间:2018-07-07 15:19:06

标签: javascript node.js node-request

我正在尝试抓取URL(https://www2.sancristobalseguros.com.uy/PortalScNet_UY/Productores/Login/Loguin.aspx),由于某种原因,我什至无法获得内容,并出现套接字挂起错误:

  

未处理的拒绝RequestError:错误:套接字挂断       在新的RequestError(C:\ Users \ x \ Desktop \ App \ node_modules \ request-promise-core \ lib \ errors.js:14:15)       在Request.plumbing.callback(C:\ Users \ x \ Desktop \ App \ node_modules \ request-promise-core \ lib \ plumbing.js:87:29)       在Request.RP $ callback [作为_callback](C:\ Users \ x \ Desktop \ App \ node_modules \ request-promise-core \ lib \ plumbing.js:46:31)       在self.callback(C:\ Users \ x \ Desktop \ App \ node_modules \ request \ request.js:185:22)       在emitOne上(events.js:116:13)       在Request.emit(events.js:211:7)       在Request.onRequestError(C:\ Users \ x \ Desktop \ App \ node_modules \ request \ request.js:877:8)       在emitOne上(events.js:116:13)       在ClientRequest.emit(events.js:211:7)       在TLSSocket.socketErrorListener(_http_client.js:387:9)       在emitOne上(events.js:116:13)       在TLSSocket.emit(events.js:211:7)       在emitErrorNT上(internal / streams / destroy.js:64:8)       在_combinedTickCallback(内部/进程/next_tick.js:138:11)       在process._tickCallback(internal / process / next_tick.js:180:9)

我可以得到任何其他SSL页面,但是我没有。我可以获取它的HTTP版本,但是我需要获取HTTPS,因为我需要收集Cookie等。

下面是代码(简单):

const re = require("request-promise");
const $ = require("cheerio");

const inUri = "https://www2.sancristobalseguros.com.uy/PortalScNet_UY/Productores/Login/Loguin.aspx";

re.get(inUri, {
 strictSSL: false
}).then(data => {
    console.log(data);
});

0 个答案:

没有答案
相关问题