beklendiği gibi xpath çalışmıyor

0 Cevap php

From comments

I found the issue :(, Thank you so much for your help, its appreciated, the reason's was because error reporting was switched off and then there was a missing function, causing the script to stop executing in its place

Beklendiği gibi nedense bu XPath sorgu çalışmıyor

foreach($this->Xpath->query('//*[not(*)]') as $OriginalNode)
{
     echo "Node Found: " . $OriginalNode->tagName . "\r\n";
}

Bu 209 (a) düğümleri içeren bir sitede, ve bu yukarıdaki bloktan tepkisi olduğunu.

Node Found: meta
Node Found: title
Node Found: meta
Node Found: link
Node Found: meta
Node Found: link
Node Found: script
Node Found: style
Node Found: a
/*Snipped link,meta for readability*/

Onun doğru düğümleri bulma neden herkes bilir!

Ve bazı kod örneği

//...
<li id="menu-item-5955" class="menu-item menu-item-type-post_type menu-item-5955">
    <a href="http://sample.com/?page_id=5896">Boardwalk Empire</a>
</li> 
<li id="menu-item-6199" class="menu-item menu-item-type-post_type menu-item-6199">
    <a href="http://sample.com/?page_id=6188">The Defenders 2010</a>
</li>
<li id="menu-item-6203" class="menu-item menu-item-type-post_type menu-item-6203">
    <a href="http://sample.com/?page_id=6170">Detroit 1-8-7</a>
</li> 
<li id="menu-item-5953" class="menu-item menu-item-type-post_type menu-item-5953">
    <a href="http://sample.com/?page_id=5909">THE EVƎNT</a>
</li> 
<li id="menu-item-5951" class="menu-item menu-item-type-post_type menu-item-5951">
    <a href="http://sample.com/?page_id=5934">Chase</a>
</li>
//...

0 Cevap