When crawling a web page, we obtained below data.
<div id="productDetails">
<span>MacBook Air 13"</span>
<span>$999</span>
</div>
Using cheerio
, we need to take the content of first span. Here is how:
$("#productDetails span").first().text();
When crawling a web page, we obtained below data.
<div id="productDetails">
<span>MacBook Air 13"</span>
<span>$999</span>
</div>
Using cheerio
, we need to take the content of first span. Here is how:
$("#productDetails span").first().text();