Tell me, please, how, using PHP Simple HTML DOM Parser, select the blocks "2009 Dodge Journey" and "2010 Dodge Journey":

<h1> 2009 Dodge Journey <span class="ad-id">ID 1139495366</span> 2010 Dodge Journey <span class="ad-id">ID 1139474783</span> </h1> 

I have either the entire text chosen "2009 Dodge Journey ID 1139495366" ... Or with a <span> tag.

    1 answer 1

    It is possible to work with the htmlDOM object as with a regular object, so we simply delete unnecessary information and extract the remaining text.

     $html->find("h1", 0)->find('span', 0)->innertext = ''; $html->find("h1", 0)->plaintext;