I am useing Zend\Dom\Query to get specific content from a webpage.
This is the html:
<div class="menuName darkGreen leftMenu">
<a href="index.php?ref=MjBfMDJfMDZfMTRfMV8x">Mouse</a>
</div>
How can I get the value Mouse ??
Thanks
Try this:
$dom = new \Zend\Dom\Query($html);
$results = $dom->execute('div.menuName a');
$doc = $results->current();
var_dump($doc->nodeValue);
current() function. I need the documentation. I have another problem like below <br/> <div class="logo_left"> <a href="http://www.abc.com"> <img alt="abc" data-cfsrc="abc" src="**http://www.abc.com/logo.jpg**"> </a> </div> <br/> I would like to catch img src attribute. <br/> Thanks