Re: [PHP] DOM - parse HTML document [solved]
At 12:07 AM +0200 9/13/06, Leonidas Safran wrote: Hello all, I have found a way... $doc = new DomDocument(); $doc-loadHTMLFile($source[url]); $elements = $doc-getElementsByTagName(tr); $i = 0; while( $elements-item($i) ){ if( $elements-item($i)-hasAttributes() preg_match(/td[0|1]/,$elements-item($i)-getAttribute(id)) 0 ){ echo $elements-item($i)-nodeValue . br /; } $i++; } Works like i want... Regards, LS Interesting -- it doesn't work for me. I keep getting -- Parse error: parse error, unexpected T_OBJECT_OPERATOR -- in your if statement. But, I don't see the problem. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DOM - parse HTML document [solved]
Hello Tedd, Interesting -- it doesn't work for me. I keep getting -- Parse error: parse error, unexpected T_OBJECT_OPERATOR -- in your if statement. But, I don't see the problem. Maybe it has something to do with your php version. I have php 5.04 installed (Fedora Core 4 rpm package). Hope that helps! Regards, LS -- Feel free - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DOM - parse HTML document [solved]
At 10:02 PM +0200 9/13/06, Leonidas Safran wrote: Hello Tedd, Interesting -- it doesn't work for me. I keep getting -- Parse error: parse error, unexpected T_OBJECT_OPERATOR -- in your if statement. But, I don't see the problem. Maybe it has something to do with your php version. I have php 5.04 installed (Fedora Core 4 rpm package). Hope that helps! Regards, LS Yep, that was it -- I'm working with 4. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DOM - parse HTML document [solved]
Hello all, I have found a way... $doc = new DomDocument(); $doc-loadHTMLFile($source[url]); $elements = $doc-getElementsByTagName(tr); $i = 0; while( $elements-item($i) ){ if( $elements-item($i)-hasAttributes() preg_match(/td[0|1]/,$elements-item($i)-getAttribute(id)) 0 ){ echo $elements-item($i)-nodeValue . br /; } $i++; } Works like i want... Regards, LS -- Feel free - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php