title: How to click on item in navigation bar on top of page using selenium python?
body: <p>I am trying to test a web page using selenium python. All is working well but issue is encountering when clicking on navbar item </p>
  
  <p>I have used:</p>
  
  <pre><code>driver.find_element_by_xpath('./li/a[. = "Log in"]')
  </code></pre>
  
  <p>Also have used:</p>
  
  <pre><code>driver.find_element_by_link_text('Log in')
  </code></pre>
  
  <p>Nothing got luck !!</p>
  
  <p>The code snippet:</p>
  
  <pre><code>&lt;div class='container'&gt;
  &lt;div class='navigationbar__header'&gt;
  &lt;a class='navigationbar__header__logo tracking-link' data-link-name='logo' href='/' target='_self'&gt;
  &lt;div id='hired-brand'&gt;HIRED&lt;/div&gt;
  &lt;/a&gt;
  &lt;/div&gt;
  &lt;div class='navigationbar__toggle'&gt;
  &lt;div class='navigationbar__toggle__element'&gt;
  &lt;img alt='Menu' class='icon icon--sandwich' src='data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'&gt;
  &lt;/div&gt;
  &lt;input class='navigationbar__toggle__helper' type='checkbox'&gt;
  &lt;ul class='navigationbar__navigation'&gt;
  &lt;li class="navigationbar__item "&gt;&lt;a class="sm-ml0 tracking-link" data-link-name="employers_page" target="_self" href="/employers"&gt;For Employers&lt;/a&gt;&lt;/li&gt;
  &lt;li class="navigationbar__item "&gt;&lt;a class="sm-ml0 tracking-link" data-link-name="success_stories" target="_self" href="/success-stories"&gt;Success Stories&lt;/a&gt;&lt;/li&gt;
  &lt;li class="navigationbar__item "&gt;&lt;a class="sm-ml0 tracking-link" data-link-name="employers_resources" target="_self" href="/employers/resources"&gt;Resources&lt;/a&gt;&lt;/li&gt;
  &lt;li class="navigationbar__item "&gt;&lt;a class="text-medium sm-ml0 tracking-link" data-link-name="login" target="_self" href="/login"&gt;Log in&lt;/a&gt;&lt;/li&gt;
  &lt;div class='xs-ptb1 xs-prl1 md-ptb0 md-inline-block'&gt;&lt;li class="navigationbar__item "&gt;&lt;a class="button button--primary tracking-link" data-link-name="signup" target="_self" href="/signup"&gt;Sign Up&lt;/a&gt;&lt;/li&gt;&lt;/div&gt;
  
  &lt;/ul&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/nav&gt;
  </code></pre>
  
  <p>This code is visible on page inspect easily. Anyone know the better way to interact with it?</p>