Finding div class value using php simple html dom or phpQuery -


i'm trying hang of php simple html dom , i'm having issues when comes div classes.

for example, on newegg want find value of div class'skiplink' (i picked random class on site). according php simple html dom documentation found here should use.

$html = file_get_html('http://www.newegg.com');  print_r($ret = $html->find('.skiplink')); 

right hangs , seems freeze. know installation working because following code works.

foreach($html->find('a') $element)     echo $element->href . '<br>'; 

basically, how can @ specific div class on given website , find value?

is there easier way this, such phpquery

from simple search on site: how value <div>value</div>?

but here say;

$doc = new domdocument(); $doc->loadhtmlfile('http://www.results.com'); $thediv = $doc->getelementbyid('result'); echo $thediv->textcontent; 

or can find innertext value of div clause grabbing value id;

$div = $doc->getelementbyid('result'); if($div) {     echo $div->textcontent; } 

Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -