title: How to click on link inside table selenium webdriver java
body: <p>I m trying to click on the link that inside a table row that is under the second &quot;doctype&quot; but when I use the xpath/title it doesn't see it it only see the top  not the child one.</p>
  <pre><code>WebElement divList = driver.findElement(By.xpath(&quot;/iframe/html/body/div[2]&quot;));
  divList.getSize();
  System.out.println(&quot;&gt;&gt;&gt;&gt;??&quot; + divList.getSize());
  
  List&lt;WebElement&gt; allCreditCards = creditCardsList.findElements(By.xpath(&quot;//*[@id='&quot; + x + &quot;']/li&quot;));
  System.out.println(&quot;CardsAre: &gt;&quot; + allCreditCards.size());
   for (int i = 0; i &lt;= allCreditCards.size(); i++) {
       int temp = i + 1;
       String creditcard = allCreditCards.get(i).getText();
       System.out.println(&quot; i is = &quot; + creditcard + &quot; &quot; + i);
       if (creditcard.equals()) {
           driver.findElement(By.xpath(&quot;//*[@id='&quot; + x + &quot;']/li[&quot; + temp + &quot;]/a&quot;)).click();
           break;
       
  </code></pre>
  <p>Please see attached image for the html page.</p>
  <p><img src="https://i.stack.imgur.com/2pxM5.png" alt="enter image description here" /></p>