code: def _get_parent(root):
      
  
      elem = root
  
      while True:
          elem = elem.getparent()
  
          if elem.tag in ['ul', 'ol']:
              return elem
docs: Returns root element for a list.
  
      :Args:
        root (Element): lxml element of current location
  
      :Returns:
        lxml element representing list