CSS selector excludes hpricot elements

I am trying to write a CSS selector that selects everything except the script elements with hpricot, I can easily select the entire contents of the select-me div and then remove the script elements, but I was wondering if you could use a selector that excludes 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 come back:

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

Greetings

+4
source share
1 answer

You may try:

 "div.select-me :not(script)" 
+6
source

Source: https://habr.com/ru/post/1308790/


All Articles