更新:
我想出来了。请参阅下面的答案
我有一个这样的xml,我想选择
a[type="foo"] d
. 我正在使用
cheerio
. 我已经到了
d = $('a[type=foo]')
<a type="foo">
<b>
<c>
<d blah="fop" bung="frum">
<e>Lorem Dramam</e>
</d>
<f>sp. cr.</f>
</c>
</b>
<b box="[4,7,18,22]" from="31" to="32">
urn:foo:bar:baz
<g box="[2,9,10,12]" code="AC" from="31" to="32">AC</g>
crummy
<h box="[7,12,22,30]" country="Nigeria">A</h>
winter
</b>
</a>
回答:
const d = $('a[type=foo] d')