select_empty

returns elements that do not have text content.

Source


def select_empty(self):
    ret = pyNodeList()
    for node in self:
        if node.name() != 'comment':
            if node.text() == '':
                ret.append(node)
    if len(ret) == 1: return ret[0]
    else: return ret