Using 'or' in extraction patterns

Hi - I was looking at your pattern for Goal.com (https://github.com/fivefilters/ftr-site-config/blob/master/goal.com.txt) 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

<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>
</html>

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

http://www.xpathtester.com/xpath/b90229202959aa5ea61dab70b34772d0