views:

231

answers:

1

Hey,

I am trying to write a CSS selector that select everything except the script elements with hpricot, I can easily select the all the contents of the select-me div and then remove the script elements but I was wondering if its possible to use a selector which will exclude the script elements:

<div class='select-me'>
<p>This is some text</p>
<script>
javascript would be here
</script>
<p>This is some text</p>
</div>

So in the end I get back:

<div class='select-me'>
<p>This is some text</p>
<p>This is some text</p>
</div>

Cheers

+2  A: 

You can try:

"div.select-me :not(script)"
karim79