title: Xpath in selenium basic: click on an href nested in <ul><li>
body: <p>with Selenium Basic I tried to click on the element 'MyLocalLang' nested in <code>&lt;li&gt;</code> tags.
  The source is:</p>
  
  <pre><code>&lt;div id="navBar" class="NavBar"&gt;
  &lt;nav id="navMenu" class="Wrapper"&gt; == 40
      &lt;ul class="navMenuUL"&gt;
          &lt;li&gt; ... &lt;/li&gt;
          &lt;li&gt; ... &lt;/li&gt;
          &lt;li&gt; ... &lt;/li&gt;
          &lt;li&gt; ... &lt;/li&gt;
          &lt;li&gt; ... &lt;/li&gt;
          &lt;li&gt; ... &lt;/li&gt;
          &lt;li&gt; ... &lt;/li&gt;
          &lt;li&gt; ... &lt;/li&gt;
          &lt;li&gt; 
              &lt;a class="nav" href="//en.mysite.com/item/"&gt;MyLocalLang&lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt; ... &lt;/li&gt;
      &lt;/ul&gt;
  &lt;/nav&gt;
  </code></pre>
  
  <p></p>
  
  <p>I must select only that exposes <code>&lt;li&gt;</code> tag: the other tags contains useless informations.
  The code <code>driver.FindElementByXPath("//*[@id='navMenu']/ul/li[9]/a")</code> works well, but:</p>
  
  <ul>
  <li>Not always MyLocalLang is the nineth element of the bar;</li>
  <li>MyLocalLang name link string could be in any other languages, so MaLangueLocale, MiaLinguaLocale, MiIdiomaLocal, etc.;</li>
  <li>the url could be in many other languages, so could be fr.mysite.com, it.mysite.com, en.mysite.com, etc.</li>
  <li>the @class 'nav' is not useful, because exists in every <code>&lt;li&gt;</code> tags.</li>
  </ul>
  
  <p>My attempts didn't work.
  I tried:</p>
  
  <pre><code>driver.FindElementByXPath("//*[@id='navMenu']/ul/li[contains(@href,'*mysite.com/item/')]/a").Click
  </code></pre>
  
  <p>with or without final <code>/a</code>, and many others.</p>
  
  <p>Can anyone help me to make the right xpath expression, and click on that link, no matters the local language is or its position in the list, please? Note that I'm using selenium in a VBA project.</p>
  
  <p>Thanks in advance.</p>