Re: GetElementByClass?

From: Date: Sat, 03 Apr 2010 15:47:38 +0000
Subject: Re: GetElementByClass?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-303799@lists.php.net to get a copy of this message
<?php // here is where you load a single file or change to iterate over a // directory of files $oDomDoc = DOMDocument::loadHTMLFile('./tedd.html'); // here is where you search for the question sections of each file $oDomXpath = new DOMXPath($oDomDoc); $oNodeList = $oDomXpath->query("//p[@class='question']"); // here is where you extract the question sections of each file foreach($oNodeList as $oDomNode) var_dump($oDomNode->nodeValue); should be trivial to expand that to work w/ multiple files.
Now, I can extract each question by using javascript -- document.getElementById("question").innerHTML;
tedd, are you slipping? i thought you were searching by the class attribute, lol. -nathan
Beautiful! -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

« previous php.general (#303799) next »