. My question is: how can I do xPa...">

Is there an "or" in XPath selectors?

I have the following xPath that gets the image from <div class="separator"> . My question is: how can I do xPath to search in <div class="entry"> as well?

 $img = $xpath->query('//div[@class="separator"]//img'); 

Thanks in advance:)

+7
source share
3 answers
 $img = $xpath->query('//div[@class="separator" or @class="entry"]//img'); 
+7
source
 $img = $xpath->query('//div[@class="separator"]//img | //div[@class="entry"]//img'); 
0
source
 $img = $xpath->query('//div[@class="separator" or @class='entry']//img'); 
0
source

All Articles