<分区>
我有以下 html,我正在尝试找出正确的选择器逻辑来读取某些部分。 注意:我无法更改 html,因为它是由插件生成的。
<li class="select2-selection__choice" title="">
<span class="select2-selection__choice__remove" role="presentation">×</span>
MS Office
</li>
<li class="select2-selection__choice" title="">
<span class="select2-selection__choice__remove" role="presentation">×</span>
Photoshop
</li>
我正在尝试读出
中的文字 <li class="select2-selection__choice">
但不包括
<span class="select2-selection__choice__remove">
所以对于上面的示例,我希望解析出以下文本:
MS Office, Photoshop