def get_base_url(response):
    """Return the base url of the given response, joined with the response url"""
    if response not in _baseurl_cache:
        text = response.text[0:4096]
        _baseurl_cache[response] = html.get_base_url(text, response.url,
            response.encoding)
    return _baseurl_cache[response]
Return the base url of the given response, joined with the response url
stackoverflow/venv/lib/python3.6/site-packages/scrapy/utils/response.py