has_cls

returns True if the element has a specified class attribute value.

Arguments

Source


def has_cls(self, cls):
    if 'class' in self._attr:
        cls_name = re.compile(cls)
        if cls_name.search(self._attr['class']) is not None:
            return True
    return False