title: Locate element inside frame
body: <p>I have the following HTML code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;td class="gnb_menu" id="MAIN_04" name="MAIN_04" style="width:100px;text-align:center;"&gt;
    &lt;span style="cursor:pointer;"  onclick="javascript:movePage('MAIN_04','/basis/menuServlet.do?method=getMenuUrl','body','Y')"&gt;
      &lt;nobr&gt;Business&lt;/nobr&gt;
    &lt;/span&gt;
  &lt;/td&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am trying to get the XPath of the span tag. I am using Selenium and have tried this:</p>
  
  <pre><code>cd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
  var d = cd.FindElementByXPath("//td[@id='MAIN_04']/span[@style='cursor:pointer;']");
  d.Click();
  </code></pre>
  
  <p>But keep running into the error: <code>"OpenQA.Selenium.NoSuchElementException has been thrown"</code> because it is unable to locate the element/no such element.</p>
  
  <p>I have tried many different XPath <code>(//*[@id='MAIN_04']/span)</code>,<code>(//td[@id='MAIN_04']/span)</code>, etc. but still cannot get this right. I even tried to take out the implicit wait because I thought it was a timeout error... I don't know.</p>
  
  <p>PLEASE HELP I am new to this and I'm so confused. Thank you!</p>