php - Obtain text between p tags within only certain span IDs with DOMdocument or SimpleDOM? -


i trying pull plaintext between <p> tags if between span id='a' , span id='b'. simpledom seems work, , i've yet find way coax domdocument produce output @ all.

maybe can you:

$doc = new domdocument();    @$doc->loadhtml($html);    $xpath = new domxpath($doc);   $elements = $xpath->query("//*/p/span[@id='a']"); 

Comments

Popular posts from this blog

Python __call__ special method practical example -

arrays - jQuery - Retrieve values from HTML elements and return their sum -