title: How to get tag name in Selenium Python?
body: <p>Is there any way to get name of the tag of selenium web element??</p>
  <p>I found, there is <code>.getTagName()</code> in selenium for java, <em>here:<a href="https://www.tutorialspoint.com/how-do-i-get-a-parent-html-tag-with-selenium-webdriver-using-java" rel="noreferrer">https://www.tutorialspoint.com/how-do-i-get-a-parent-html-tag-with-selenium-webdriver-using-java</a></em></p>
  <p><strong>EDIT</strong>:</p>
  <p>example: In this HTML, if I iterate though class='some_class_name', how can I get the tag_name (<code>h2</code>,  <code>p</code>, <code>ul</code> or <code>li</code>)</p>
  <pre><code>&lt;div class='some_class_name'&gt;
      &lt;h2&gt;Some Random Heading 1&lt;/h2&gt;
      &lt;p&gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry&lt;/p&gt;
  
      &lt;h2&gt;Some Random Heading 2&lt;/h2&gt;
      &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.&lt;/p&gt;
      &lt;p&gt;Random list are:&lt;/p&gt;
      &lt;ul&gt;
          &lt;li&gt;Lorem&lt;/li&gt;
          &lt;li&gt;Ipsum&lt;/li&gt;
          &lt;li&gt;Dolor&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  
  </code></pre>
  <p>Python code may look like this..</p>
  <pre><code>content = driver.find_elements_by_xpath(&quot;//div[@class='some_class_name']//child::*&quot;)
  for c in content:
      print(c.getTagName())      # something like this to get the tag of inner content..
  </code></pre>