select_disabled

returns elements that have the attribute disabled and the value disabled or not.

Source


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