title: Get grandParent using xpath in selenium webdriver
body: <pre><code>&lt;div class="myclass"&gt;
    &lt;span&gt;...&lt;/span&gt;
    &lt;div&gt;
         &lt;table&gt;
                &lt;colgroup&gt;...&lt;/&gt;
                &lt;tbody&gt;
                      &lt;tr&gt;...&lt;/tr&gt;
                      &lt;tr&gt;
                           &lt;td&gt; 
                                &lt;input ...name="myname" ...&gt; 
                           &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;...&lt;/tr&gt;
                &lt;tbody&gt;
         &lt;/table&gt;
    &lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>this is my html code ... I have attribute "name" ..so I can access   tag ...but from this line I want to access top  element.
  One way is that I write <code>driver.find_element_by_xpath('..')</code> 6-7 times to get that parent but I dont know how many steps I have to go above. I simply want a xpath expression or similar thing to access top .</p>
  
  <p>I'm using Selenium webdriver with python</p>