我正在尝试编写一个 CSS 选择器,它使用 hpricot 选择除脚本元素之外的所有内容,我可以轻松选择 select-me div 的所有内容,然后删除脚本元素,但我想知道是否可以使用选择器将排除脚本元素:
<div class='select-me'>
<p>This is some text</p>
<script>
javascript would be here
</script>
<p>This is some text</p>
</div>
所以最后我回来了:
<div class='select-me'>
<p>This is some text</p>
<p>This is some text</p>
</div>
干杯