cheerio Парсинг значения из Angular компонента
Подскажите, как при помощи cheerio можна получить значение из компонета. Вот пример
const cheerio = require("cheerio")
const htmlMy = `<app-profile-rtm-display
_ngcontent-ng-c1195445827=""
class="ng-tns-c1195445827-4"
_nghost-ng-c3921012271=""
><span _ngcontent-ng-c3921012271="" class="text is-subheader is-flex"
><span _ngcontent-ng-c3921012271="" class="has-text-color-primary"
>Country</span
></span
><span _ngcontent-ng-c3921012271="" class="ng-star-inserted"
><div
_ngcontent-ng-c3921012271=""
class="metadata-field-tag-container ng-star-inserted"
>
<div
_ngcontent-ng-c3921012271=""
placement="top"
class="metadata-value-tag ng-star-inserted"
style="
color: var(--theme-content-text-icon-color);
background-color: var(--theme-content-bg-color_high-contrast-10);
"
>
Sweden
</div>
</div>
</span
></app-profile-rtm-display
>`
const $ = cheerio.load(htmlMy)
const country =
$('app-profile-rtm-display:contains("Country") div.metadata-value-tag')
.text()
.trim() || "N/A"
console.log(country)
<script src="https://cdn.jsdelivr.net/npm/cheerio/dist/esm/index.min.js"></script>
Я хочу в консоль получить значение Sweden ... Но что-то не понимаю синтаксис обработки. Думал что тут так же как в jQuery
, но не получается.