title: Java Selenium find element (xpath)
body: <p>This is my first post in StackOverFlow, and being a chinese, please ignore my poor english lol.</p>
  
  <p>I am trying to use selenium do following actions:
  1.open the url(url in code)
  2. click "zonal" link under the "Real-Time Market LBMP" menu, which has unique tag"P-24A"
  3. get the time for "most recent interval" file and print out.</p>
  
  <p>High lighted elements are my target:</p>
  
  <p><a href="https://i.stack.imgur.com/DEA3m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DEA3m.png" alt="enter image description here"></a></p>
  
  <p>I was stucked with second xpath selector:</p>
  
  <pre><code>    System.setProperty("webdriver.gecko.driver", "C:/Users/Haiqing/Downloads/geckodriver-v0.11.1-win64/geckodriver.exe");
      WebDriver wd = new FirefoxDriver(); 
  
      wd.get("http://mis.nyiso.com/public/"); 
      wd.switchTo().frame("MENU");
  
      WebElement zonalElement = wd.findElement(By.name("P-24Alist"));
      zonalElement.click();
  
      wd.switchTo().defaultContent();
      wd.switchTo().frame("BODY");
      WebElement mostRecentIntervalTime = wd.findElement(By.xpath("//a[contains(text(), 'Most recent interval')]/../following-sibling::td/span"));
      System.out.println("Most recent updated time is : " + mostRecentIntervalTime.getText()); 
      wd.quit();
  </code></pre>
  
  <p>And the HTML is belowed:
          
          
          Most recent interval
          
          
          12/04/16 06:42 EST
          
          
          </p>
  
  <p>got exception <a href="https://i.stack.imgur.com/m1diY.png" rel="nofollow noreferrer">enter image description here</a></p>