Q:

Xpath getting divs and h3 between them

Suppose the following structure
<div>Content 1</div>
<h3>head 2</h3>
<div>Content 2</div>
<h3>head 3</h3>
<div>Content 3</div> 

I need to access all divs and the h3 following each of them.
I tried //div[*] but it just only returns divs without h3. I need to know something like concatenation or something like it.

A:

Some possible ways, using XPath union (|) :
//div | //h3

Or matching by name() :
//*[name()='div' or name()='h3']

