def split_elem_def(path):
    """Get the element name and attribute selectors from an XPath path."""
    path_parts = path.rpartition('/')
    elem_spec_parts = path_parts[2].rsplit('[')
    # chop off the other ']' before we return
    return (elem_spec_parts[0], [part[:-1] for part in elem_spec_parts[1:]])