Q:

How to get html elements from different class xpath? 

I know how to get a list of DIVs of the same css class e.g
<div class="class1">1</div>
<div class="class1">2</div>

using xpath //div[@class='class1']
or 
div have multiple classes, e.g
<div class="class1 class2">1</div>

using xpath //div[contains(@class, 'class1') and contains(@class, 'class2')]
But how if  div have different classes, e.g
<div class="class1">1</div> 
<div class="class2">2</div>

What will the xpath like then? 
Thanks in advanced for help. 

A:

You could use this query: //div[contains(@class,'class1') or contains(@class, 'class2')]
This syntax would be better though: //div[class^='class'] if you want to grab all div tags that contain 'class' at the beginning of the class attribute.