Good day to all who read. I can’t separate the time to add an article from a category.

<div class="pull-left text-muted"> <time>50 минут назад</time> | новости </div> 

The tag "<time>" with its contents I do not need, you only need "| news" Pars for phpQuery, that is, just started. already tried different filters and intersections. It is impossible to select only the text of the parent element. I would be very grateful for the help. Thank you in advance.

  • Here search ru.stackflow.com/... options do not suit you? - nick_n_a
  • Here the fact is that I use phpJquery and not xPach, thanks for reminding me about the search. :) - TojaKartoha

1 answer 1

 let tempObj = $('.text-muted').clone(); tempObj.children().each(function(){ $(this).remove(); }); console.log(tempObj.text()); 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="pull-left text-muted"> <time>50 минут назад</time> | новости </div> 

  • Thank you very much. Chet did not even think ... But I would like to use phpQuery. I will try to transfer it to php. - TojaKartoha
  • one
    Glad to help, please contact)) - Ilia Brykin