title: How to scrape a page for certain strings from an array of substrings with Nokogiri
body: <p>I want to scrape a restaurant page for certain titles of dishes.
  I created an array holding keywords: </p>
  
  <pre><code>myarray = {"Rice", "Soup", "Chicken", "Vegetables"}
  </code></pre>
  
  <p>Whenever one of those keywords is found in a webpage, my scraper is supposed to give me the entire dish-title. I made this work with the following code:</p>
  
  <pre><code>html_doc = Nokogiri::HTML.parse(browser.html)
  
  
  word = html_doc.at(':contains("Rice"):not(:has(:contains("Rice")))').text.strip
  puts word
  </code></pre>
  
  <p>For example this returns: "Dish 41 - Vegetables with Chicken and Rice"</p>
  
  <p>The problem is that the above code stops after the first dish is found. It does not loop through all dish-titles containing the word rice. 
  Secondly, I do not know how to let the code check for an entire array of substrings.</p>