var cheerio = require('cheerio');
var request = require('request');
request('https://www.mobcrush.com', function(err, resp, body){
if(!err && resp.statuscode == 200){
var $ = cheerio.load(body)
var testing = $('#main-content')
console.log(testing)
}
});
尝试抓取网站,但控制台日志显示空白
答案 0 :(得分:1)
一切都很好
您已statusCode
而不是 try {
if (!err && resp.statusCode == 200) {
console.log('ssss');
var $ = cheerio.load(body)
var testing = $('#main-content');
console.log(testing);
}
} catch (e) {
console.log(e)
}
var phrasesCount = await db.Phrases.CountAsync();