嗨,我正在尝试制作一个选择器,从中选择数字332
<div data-stat="PVPMatchesWon" class="trn-defstat__value">
332
</div>
但我不知道怎么做…我正在尝试Cheerio和Jquery,但它不起作用。。。
let wins = $(`div.trn-defstat--large:nth-child(1) > div:nth-child(2)`).text()
( div.trn-defstat--large:nth-child(1) > div:nth-child(2) )
这是css选择器。
我知道我的问题对一些人来说很容易,但我被卡住了。
可能只是:
$('[data-stat="PVPMatchesWon"]').text()
我怀疑还有另外一个。