dimanche 6 mars 2016

x-ray web scraper I can not get the text with accents

I'm trying to retrieve a text that has accents but these appear to me as?, then use iconv to convert Windows-1252 but all my characters with accents are replaced by ý.

My code is this:

exports.buscar = function (req, res){
var x = Xray();
x('http://www.google.com', 'div .x7', [{
    descripcion: '.tx',
    precio: '.x11 .pr'
}])
(function(err, obj) {
    var busqueda = JSON.stringify(obj);
    var utf8String = iconv.decode(busqueda, 'Windows-1252');
    res.send(utf8String);
});

};




Aucun commentaire:

Enregistrer un commentaire