def add_http_if_no_scheme(url):
    """Add http as the default scheme if it is missing from the url."""
    match = re.match(r"^\w+://", url, flags=re.I)
    if not match:
        parts = urlparse(url)
        scheme = "http:" if parts.netloc else "http://"
        url = scheme + url

    return url
Add http as the default scheme if it is missing from the url.
stackoverflow/venv/lib/python3.6/site-packages/scrapy/utils/url.py