PHP Classes

How to get the HTML

Recommend this page to a friend!

      HTMLPP  >  All threads  >  How to get the HTML  >  (Un) Subscribe thread alerts  
Subject:How to get the HTML
Summary:How to get the inner HTML of Elements
Messages:2
Author:Cẩm
Date:2010-11-26 03:35:15
Update:2010-11-26 08:08:34
 

  1. How to get the HTML   Reply   Report abuse  
Picture of Cẩm Cẩm - 2010-11-26 03:35:15
I have some questions about your class.
After I use getElementsBySelector, I have HTMLCollection
How to get the innerHTML of all the element in collection.
I've used
$col=& $document->getElementsBySelector("#Mod122 a:first-child");
foreach($col as $key=>$value){
echo $value->getInnerHTML();
}
But nothing happen.

  2. Re: How to get the HTML   Reply   Report abuse  
Picture of Marco Marchiņ Marco Marchiņ - 2010-11-26 08:08:34 - In reply to message 1 from Cẩm
Try with this:
$col=& $document->getElementsBySelector("#Mod122 a:first-child");
foreach($col->elements as $key=>$value){
echo $value->getInnerHTML();
}