ruby - How to select all children except x from a HTML node -


i have block of html need extract text:

<div class="comment">   <span class="c00">   text   <p>text</p>   <p>text</p>   <div class="reply">reply</div>   </span> </div> 

note 'text' text node no html tags within span class="c00".

how select texts without div class="reply"?

i tried :not operator:

.c00:not(.reply) 

but did not work.

looks can't. set styles .c00 , overwrite in .reply:

.c00 {    color: #f00;    font-weight: 700;    font-style: italic;  }  .reply {    color: #000;    font-weight: 400;    font-style: normal;  }
<div class="comment">    <span class="c00">    text    <p>text</p>    <p>text</p>    <div class="reply">reply</div>    </span>  </div>


Comments

Popular posts from this blog

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -