how to get p tag text under a specific parent class php parse htm

Viewed 22

I am parsing a html file and in that I need to get p tag text under a div with a specific class ,

tag desnt have class or id attribute

    foreach($xpath->evaluate('//div[contains(@class, "wpb_wrapper")]/node()') as 
     $childNode) {
      $content2 .= $dom->saveHtml($childNode);
    }

HTML structure is like this

<div class="wpb_wrapper">
    <p>this is text goes  here </p>
</div>
0 Answers
Related