无法在节点js中执行请求

时间:2019-11-07 13:58:00

标签: javascript node.js request cheerio

我有一些这样的代码:-

const request=require('request');
const url=require('url');
const cheerio=require('cheerio');

request({uri: 'https://www.facebook.com/'}, (err, resp, body)=>{
    var $=cheerio.load(body);
    console.log($('title').text());
    console.log($('body').text())
});

当我尝试向Facebook或google请求时,返回的响应类似于:-

Facebook - ??? ??? ?????? | Facebook
??????? login or signup ??????? ??

Google
Signin??? ???....

如何解决这些问号?

0 个答案:

没有答案