next_element

returns an element that is next.

Source


def next_element(self):
    if self.has_parent():
        brothers = self._parent.children()
        if isinstance(brothers, pyNodeList) and len(brothers) != 0:
            passed = False
            for bro in brothers:
                if bro.name() != 'comment':
                    if passed:
                        return bro
                    else:
                        if bro == self:
                            passed = True
    return None