title: or condition in selenium xpath
body: <p>How to implement or condition in <code>xpath</code> to get text inside the table <code>td</code> ?</p>
  
  <p>From the below table, <strong>my expected output</strong> should be:</p>
  
  <pre><code>Black bean sauce
  Black bean chicken
  USA(New York)
  India(New Delhi)
  </code></pre>
  
  <hr>
  
  <pre><code> &lt;table&gt;
          &lt;tr class="foods foods_s-fndds2-f41205100"&gt;                    
                  &lt;td class="name"&gt;                   
                      &lt;a href="Javascript://"&gt;Black bean sauce&lt;/a&gt;
                  &lt;/td&gt;                     
                  &lt;td class="calories"&gt;280&lt;/td&gt; 
           &lt;/tr&gt;
           &lt;tr class="foods foods_s-fndds2-f41205140"&gt;                    
                  &lt;td class="name"&gt;                   
                      &lt;a href="Javascript://"&gt;Black bean chicken&lt;/a&gt;
                  &lt;/td&gt;                     
                  &lt;td class="calories"&gt;280&lt;/td&gt; 
           &lt;/tr&gt;
           &lt;tr class="foods foods_s-fndds2-f41210200"&gt; 
              &lt;td class="name"&gt;  
                  &lt;span class="truncated"&gt;&lt;a href="Javascript://"&gt;kathmandu…&lt;/a&gt;&lt;/span&gt;
                  &lt;span class="complete"&gt;&lt;a href="Javascript://"&gt;USA(New&lt;/a&gt;&lt;br&gt;
                  York)&lt;/span&gt;
              &lt;/td&gt; 
         &lt;/tr&gt;
          &lt;tr class="folder foods foods_undefined"&gt;
              &lt;td class="name" colspan="4"&gt;&lt;span&gt;&lt;/span&gt;Black, brown, or Bayo beans, dry, cooked&lt;/td&gt;
              &lt;td class="actions"&gt;&lt;a class="open" href="Javascript://"&gt;&lt;/a&gt;&lt;/td&gt;
         &lt;/tr&gt;
         &lt;tr class="foods foods_s-fndds2-f41210200"&gt; 
              &lt;td class="name"&gt;  
                  &lt;span class="truncated"&gt;&lt;a href="Javascript://"&gt;kathmandu…&lt;/a&gt;&lt;/span&gt;
                  &lt;span class="complete"&gt;&lt;a href="Javascript://"&gt;India(New&lt;/a&gt;&lt;br&gt;
                  Delhi)&lt;/span&gt;
              &lt;/td&gt; 
         &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>i tried this query but it gives only </p>
  
  <pre><code>Black bean sauce
  Black bean chicken
  </code></pre>
  
  <p>code i tried:</p>
  
  <pre><code>   List&lt;WebElement&gt; folder = driver.findElements(By.xpath("//tr/td[@class='name']/a"));
          for (WebElement webElement : folder) { 
              String foodName = webElement.getText();
              System.out.println("text======" + foodName);
    }
  </code></pre>