title: selenium click on anchor tag inside table td
body: <p>i have my html code looks like this:</p>
  
  <pre><code>&lt;div id="food-search-all" class="fd_food_search_all fd_loading" style="display: block;"&gt;
       &lt;ul class="fd-breadcrumbs" &gt; 
  
          &lt;li&gt;
              &lt;a href="Javascript://" class="breadcrumb"&gt;Baked beans&lt;/a&gt;
          &lt;/li&gt;
     &lt;/ul&gt;
  
       &lt;div class="fd-search-results"&gt;&lt;table class="results ib-list" cellpadding="0" cellspacing="0" border="0"&gt; 
          &lt;tbody&gt;           
              &lt;tr class="foods foods_s-fndds244535"&gt; 
                  &lt;td class="name"&gt; 
                      &lt;a href="Javascript://"&gt;Baked beans&lt;/a&gt;
                  &lt;/td&gt;
                  &lt;td class="default-amount"&gt; &lt;/td&gt; 
              &lt;/tr&gt;
  
              &lt;tr class="foods foods_s-fndds244535"&gt; 
                  &lt;td class="name"&gt; 
                      &lt;a href="Javascript://"&gt;Chickens&lt;/a&gt;
                  &lt;/td&gt;
                  &lt;td class="default-amount"&gt; &lt;/td&gt; 
              &lt;/tr&gt;
              &lt;tr class="foods foods_s-fndds244535"&gt; 
                  &lt;td class="name"&gt; 
                      &lt;a href="Javascript://"&gt;Cow milk&lt;/a&gt;
                  &lt;/td&gt;
                  &lt;td class="default-amount"&gt; &lt;/td&gt; 
              &lt;/tr&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;&lt;/div&gt; 
  &lt;/div&gt;
  </code></pre>
  
  <p>how can i click to the with text <code>Baked beans</code> residing inside  table/tr/td/a</p>
  
  <p>i tried this below code, </p>
  
  <pre><code>driver.findElement(By.xpath("/table[contains(@class,'results ib-list')]/tbody/tr/td[@class = 'name']/a[contains(text(),"+linktext+")]")).click();
  </code></pre>
  
  <p>but its showing exception:</p>
  
  <pre><code> org.openqa.selenium.InvalidSelectorException: The given selector  
  </code></pre>