Answer the question
In order to leave comments, you need to log in
How to parse html code?
Hello! There is the following code:
...
<div class="issue">
<h2 class="notop">***</h2>
<div class="grid_2 alpha alcenter download_issue">
<a href="***"><img src="images/download_pdf.png"/></a><br />
PDF, 10 Мб
</div>
<div class="grid_10 omega">
текст
</div>
</div>
Answer the question
In order to leave comments, you need to log in
You can use Zend\Dom\Query
use Zend\Dom\Query;
$dom = new Query($html);
$nodes = $dom->execute('div.issue');
foreach ($nodes as $node) {
// $node is a DOMElement http://php.net/manual/ru/class.domelement.php
echo $node->C14N();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question