import urllib.parse

def make_links_absolute(soup, url):
    for tag in soup.findAll('a', href=True):
        tag['href'] = urllib.parse.urljoin(url, tag['href'])
Python BeautifulSoup equivalent to lxml make_links_absolute