$this->url = $url ; $this->dom = new DomDocument(); $this->dom->loadHTMLFile($url); $this->xpath = new domxpath($this->dom); $nodes = $this->xpath->query("//form"); foreach ($nodes as $node) { //var_dump($node); print $node->textContext; //echo $items->item($i)->nodeValue . "\n"; //echo "$class\n"; }