def canonical_url(self):
    canonical_link = self.soup.find('link', {'rel': 'canonical', 'href': True})
    if canonical_link:
        return urljoin(self.url, canonical_link['href'])
    return self.url
def canonical_url(self):
    canonical_link = self.soup.find('link', {'rel': 'canonical', 'href': True})
    if canonical_link:
        return urljoin(self.url, canonical_link['href'])
    return self.url