def url_is_from_spider(url, spider):
    """Return True if the url belongs to the given spider"""
    return url_is_from_any_domain(url,
        [spider.name] + list(getattr(spider, 'allowed_domains', [])))
Return True if the url belongs to the given spider
stackoverflow/venv/lib/python3.6/site-packages/scrapy/utils/url.py