I'm using phpQuery to parse a site:
HTML example:
<div class="post" id="1232323">
<div class="title">Example</div>
<div class="text">texttexttext</div>
</div>
I can find the title and text but can't find id from div.post.
$document = phpQuery::newDocument(takeCode("example.com"));
$list_elements = $document->find('div.Post');
foreach ($list_elements as $element)
{
$pq = pq($element);
$postTitle = $pq->find('div.Post')->attr('id'); //not found
$postTitle = $pq->find('div.title')->text(); //found
$postTitle = $pq->find('div.content')->text(); //found
}
How can I fix it?
$pq->attr('id')not give you that id?