Adding an exception to chose between to blocks
===

How would I chose between two block: 

    page.parser.xpath('//*[contains(concat( " ", @class, " " ), concat( " ", "realviewLink", " " ))]').each do |product|
          
    page.parser.xpath('//*[contains(concat( " ", @class, " " ), concat( " ", "gbb-productTitle", " " ))]').each do |product|

I tried adding a begin/recuse and if/else and kept getting unexpected keyword errors. How do i choose the second statement if the first statement = [] ?