def __init__(self, anchors): if not isinstance(anchors, list): anchors = list(anchors) AbstractLink.__init__(self, anchors) self.hrefs = set(i.href for i in anchors) self.type = Links.Type.ANCHOR self._href = None
def __init__(self, forms): if not isinstance(forms, list): forms = list(forms) AbstractLink.__init__(self, forms) self.forms = forms self.methods = set(i.method for i in forms) self.actions = set(i.action for i in forms) self.type = Links.Type.FORM self._elemset = None
def __init__(self, redirects): if not isinstance(redirects, list): redirects = list(redirects) AbstractLink.__init__(self, redirects) self.locations = set(i.location for i in redirects) self.type = Links.Type.REDIRECT