def first(self, tagname):
    found = None
    for tag in self.contents:
        if isinstance(tag, Tag):
            if (tag.name == tagname):
                found = tag
                break
    return found
def first(self, tagname):
    found = None
    for tag in self.contents:
        if isinstance(tag, Tag):
            if (tag.name == tagname):
                found = tag
                break
    return found