Replace // with descendant:: in the second and third xpath, because // tells xpath to search for this evrywhere element in xml, and not in a specific node (as needed), and $ child is NOT a separate XML, descendat:: means any node child
@$this->dom->loadHTML($page); $xpath = new DOMXPath($this->dom);
source share