如何只爬取<strong>为'Latitude'的span值? NodeJS 欢呼声

How do I crawl the span value only where < strong > is 'Latitude'? NodeJS Cheerio

假设这个 HTML 列表:

<li>
<strong> Admin name </strong>
<span itemprop="addresslocality"> Amsterdam </span>
<li>
 <li>
<strong> Latitude </strong>
<span itemprop="addresslocality">  52.370216 </span>
<li>
 <li>
<strong> Longitude </strong>
<span itemprop="addresslocality">  4.895168 </span>
<li>

如何获取纬度和经度的跨度值?如果我只是 .get() 第二个和第三个 itemprop,它有时会给我不需要的值。 (基于列表中 itemprop 属性的数量)

尝试使用 contains 选择器:

dom.find('strong:contains("Latitude")').next().text().trim() // 52.370216