const originRequest = require("request");
const cheerio = require("cheerio");
const iconv = require("iconv-lite");

function request(url, callback) {
    const options = {
        // url: url,
        encoding: null
    };
    originRequest(url, options, callback);
}

for (let i = 103234; i < 103238; i++) {
    const url = `https://www.dy2018.com/i/${i}.html`;
    request(url, function (err, res, body) {
        console.log("body",body,err) // Here err means unable to verify the first certificate
        // const html = iconv.decode(body, "gb2312");
        // const $ = cheerio.load(html);
        // console.log($(".title_all h1").text());
    });
}

// Unable to verify the first certificate
Copy the code