Я пытаюсь проанализировать код с cheerio и запросить на узле J, и я получаю сообщение об ошибке undefined
Я проверил это, это не ошибка запроса, это просто привет, часть моего кода синтаксического анализа.
const options = Object.assign({
url: buildUrl(opts),
followAllRedirects: true
}, opts.requestOptions);
request(options, opts.throttle)
.then(cheerio.load)
.then(parseFields)
.then(function (app) {
resolve(app);
})
.catch(reject);
});
}
function parseFields ($) {
const h2 = $('faq_cat').attr('id')
const fields = {
h2
};
что я пытаюсь проанализировать
<div class="faq_cat" id="faq_box_faq2">
Спасибо всем!)
Экспресс серверное приложениекод:
const express = require('express')
const app = express()
var gplay = require('google-play-scraper');
gplay.download({downloadId: 'air.com.helloair.HELLOFROG',
nameid: 'digital-world-digimons'})
.then(console.log, console.log);
app.listen(3000, () => console.log('Example app listening on port 3000!'))
с console.log (h2)
код экрана
с console.log ($. Html ());
работа экрана!