Using 'or' in extraction patterns

Hi - I was looking at your pattern for ( and saw this:

body: //div[@id=‘article_headline’]/h2 | //div[@id=‘large_article_image’ or @id=‘article_content’]

Is that OR in the second div a valid use case?

Hi there, yes, that’s valid.

Given the HTML

<div id="article_headline"><h2>Article headline</h2></div>
<div id="large_article_image"><img src="..." /></div>
<div class="related">This will be skipped</div>
<div id="article_content">Article content</div>

Three elements will be selected with that XPath expression. You can test it out for yourself by following the link below and clicking ‘Test’.