title: What wrong in 'print_element' method ?
body: <pre><code>print("&lt;&amp;s &amp;s&gt;" &amp;(element.tag,element.attrib))
  </code></pre>
  
  <p>AttributeError: 'list' object has no attribute 'tag'</p>
  
  <pre><code>from lxml import html
  import requests
  
  def print_element(element):
      print("&lt;&amp;s &amp;s&gt;" &amp;(element.tag,element.attrib))
  
  r = requests.get("https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_and_their_capitals_in_native_languages")
  
  tree = html.fromstring(r.content)
  s = tree.xpath('//table')
  print_element(s)
  </code></pre>
  
  <p>Any help would be appreciated. Thanks!</p>