我有以下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