1

i have something like this:

<div class='rand'>
    some text...
</div>
<div class='rand1'>
    some text..
</div>
<div class='rand2'>
    some text..
</div>
.
.
.

I want to take from all the different divs only those whose class='rand' or class='rand2' all in one DOMXpath query..
Any ideas?

Manos Serifios
  • 577
  • 2
  • 7
  • 22

1 Answers1

3

Xpath:

//div[@class='rand' or @class='rand2']

Here are examples on how to run the xpath query: Parse HTML with PHP's HTML DOMDocument

Community
  • 1
  • 1
Bgi
  • 2,513
  • 13
  • 12