var http = require("http"); var iconv = require('iconv-lite'); var option = { hostname: "stockdata.stock.hexun.com", path: "/gszl/s601398.shtml" }; var req = http.request(option, function(res) { res.on("data", function(chunk) { console.log(iconv.decode(chunk, "gbk")); }); }).on("error", function(e) { console.log(e.message); }); req.end();
版权声明:除特别声明外,本站所有文章皆是本站原创,转载请以超链接形式注明出处!