select_enabled

returns enabled elements.

Source


def select_enabled(self):
    ret = pyNodeList()
    tags = ['button', 'input', 'optgroup', 'option', 'select', 'textarea']
    for node in self:
        if node.name() in tags:
            try:
                t = node._attr['disabled']
            except KeyError:
                ret.append(node)
    if len(ret) == 1: return ret[0]
    else: return ret