title: remove element from xpath tree not working
body: <p>I have a problem removing elements from my xpath list.<br>
  I am a rookie in Python and HTML scraping, so bear with me :)<br>
  I've read that <code>nodes.getparent().remove(nodes)</code> should remove an element, but I can't even compile it.<br>
  So it seems like I am not getting the element type that I need to be able to remove.<br>
  I am able to call <code>nodes.getparent()</code> without problems, but not remove on that.</p>
  
  <blockquote>
    <p>Error: <br><br>
    "TypeError: Argument 'element' has incorrect type (expected lxml.etree._Element, got lxml.etree._ElementUnicodeResult)"</p>
  </blockquote>
  
  <p>Best regards<br>
  Jesper</p>
  
  <pre class="lang-python prettyprint-override"><code>from lxml import html
  import requests
  
  headers = {'User-Agent': 'Fiddler', 'Host': 'bilmodel.dk'}
  
  page = requests.get('https://bilmodel.dk/Sitemap/Biler', headers=headers)
  tree = html.fromstring(page.content)
  
  #This will create a list of car brands
  CarBrands = tree.xpath('//*[@id="content"]/ul[1]//text()')
  for nodes in CarBrands:
      if nodes.find('\r\n\t\t\t\t') == 0:
          print('Found it')
          nodes.getparent().remove(nodes)
  
  # Press Enter to exit window
  #CarBrand = input('Write car brand:')
  print(CarBrands)
  </code></pre>