使用 iconv-lite 解决 request 乱码问题 Node.js 抓取非 utf-8 的中文网页时会出现乱码问题,比如网易的首页编码是 gb2312,抓取时会出现乱码 var request = require('request') var url = 'http://www.163.com' request(url, function (err, res, body) { console.log(body) }) 可以使用 iconv-lite 来解决 安装 npm install iconv-lite 同时我们顺带把 user-agent 修改一下,以防网站屏蔽: var