I\'m new to node.js and writing my first script to scrape some data.
Does anyone know why I\'m seeing weird characters with question marks inside them when using this co
Hey this is because of the encoding of the page you're requesting. To deal with encoding, you might want to use the module iconv-lite (https://github.com/ashtuchkin/iconv-lite) like that:
var iconv = require('iconv-lite');
var encoding = 'iso-8859-1'; // You might want to replace that with the encoding the page is using or auto detect it from the charset header
request.get({url: .., headers:..., encoding:null}, function(err,res,body){
var body1 = iconv.decode(body,encoding);
}
Have fun, this should work.