第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

node.js http.get請求返回的中文亂碼, iconv zlib模塊都不好使,求解決!??!

請求的接口是:"http://club.jd.com/comment/productPageComments.action?callback=fetchJSON_comment98vv125475&productId=1993092&score=0&sortType=5&page=2&pageSize=10&isShadowSku=0&rid=0&fold=1"網(wǎng)頁顯示中文正常,返回來的數(shù)據(jù)中文亂碼const http=require("http");const fs=require("fs")// const cheerio=require("cheerio")// const iconv=require("iconv");var url="http://club.jd.com/comment/productPageComments.action?callback=fetchJSON_comment98vv125475&productId=1993092&score=0&sortType=5&page=2&pageSize=10&isShadowSku=0&rid=0&fold=1";http.get(url,function (res) {    var html="";    // iconv.decode(res, 'gb2312')    res.setEncoding("utf-8");    res.on("data",function(chunk){        //console.log(chunk.toString())        html+=chunk;    });    res.on("end",function(){        fs.writeFile("./評價.txt",a,function(){            console.log("完成")        })    });    res.on("err",function(){        console.log(err)    })})
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 1131 瀏覽
慕課專欄
更多

添加回答

了解更多

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號